quadraticVertex()
Shape / VertexDescription
Specifies a vertex with a single control point for quadratic bezier curves.
Syntax
void quadraticVertex(float cx, float cy, float x, float y)
Parameters
| Name | Type | Description |
|---|---|---|
| cx | float | x of control point |
| cy | float | y of control point |
| x | float | x of anchor point |
| y | float | y of anchor point |
Returns
voidRelated
Under the Hood
From Processing.h:
void quadraticVertex(float cx, float cy, float x, float y);
Under the Hood
From Processing.cpp:
void PApplet::quadraticVertex(float cx,float cy,float x,float y){
if(!inShape||shapeVerts.empty())return;
auto[x0,y0]=shapeVerts.back();const int sg=bezierDetailVal;
for(int i=1;i<=sg;i++){float t=i/(float)sg,u=1-t;float qx=u*u*x0+2*u*t*cx+t*t*x,qy=u*u*y0+2*u*t*cy+t*t*y;shapeVerts.push_back({qx,qy});shapeVerts3D.push_back({qx,qy,0.0f});}
}