|
1 | 1 | #if __has_include("stb_truetype.h") |
2 | | -if __has_include("stb_truetype.h") |
3 | 2 | # define PROCESSING_HAS_STB_TRUETYPE 1 |
4 | 3 | # define STB_TRUETYPE_IMPLEMENTATION |
5 | 4 | # include "stb_truetype.h" |
@@ -1656,15 +1655,6 @@ void PApplet::quadraticVertex(float cx,float cy,float x,float y){ |
1656 | 1655 | auto[x0,y0]=shapeVerts.back();const int sg=bezierDetailVal; |
1657 | 1656 | 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});} |
1658 | 1657 | } |
1659 | | -void PApplet::quadraticVertex(float cx,float cy,float cz,float x,float y,float z){ |
1660 | | - // Convert quadratic to cubic bezier |
1661 | | - if(!inShape||shapeVerts3D.empty()) return; |
1662 | | - float ax=shapeVerts3D.back()[0],ay=shapeVerts3D.back()[1],az=shapeVerts3D.back()[2]; |
1663 | | - float cx1=ax+(2.f/3.f)*(cx-ax), cy1=ay+(2.f/3.f)*(cy-ay), cz1=az+(2.f/3.f)*(cz-az); |
1664 | | - float cx2=x+(2.f/3.f)*(cx-x), cy2=y+(2.f/3.f)*(cy-y), cz2=z+(2.f/3.f)*(cz-z); |
1665 | | - bezierVertex(cx1,cy1,cz1,cx2,cy2,cz2,x,y,z); |
1666 | | -} |
1667 | | - |
1668 | 1658 | void PApplet::curveVertex(float x,float y){if(inShape){shapeVerts.push_back({x,y});shapeVerts3D.push_back({x,y,0.0f});}} |
1669 | 1659 | void PApplet::curveVertex(float x,float y,float z){if(inShape){shapeVerts.push_back({x,y});shapeVerts3D.push_back({x,y,z});}} |
1670 | 1660 | void PApplet::bezierVertex(float cx1,float cy1,float cz1,float cx2,float cy2,float cz2,float x,float y,float z){ |
|
0 commit comments