#processing insight of the day: if you want curved shapes using curveVertex, you have to iter twice over the points
in this thread I& #39;ll share how I came to this hacky conclusion and I& #39;ll love to learn about better solutions
#creativecoding
in this thread I& #39;ll share how I came to this hacky conclusion and I& #39;ll love to learn about better solutions
#creativecoding
the first thing I noticed is that when you change from vertex to curveVertex, you don& #39;t end up with the same shape
oh, and just to be clear, I& #39;m using #python mode
oh, and just to be clear, I& #39;m using #python mode
after that, I realized that when I repeat the first 3 points, I got the curved square as I wished. but notice that if I only repeat the first 2 points, I end up with a square with one straight side
this is explained in the docs, but it& #39;s still confusing for me to get it. in a short summary, when using curveVertex, the first and the last points are only used as control points for the curve. thanks to @villares for the contribution here!
so, I came to the conclusion that, if I want to have a curve shaped object I& #39;d have to repeat the n-1 points. that was true until I tried using triangles =S
for the triangles, I had to repeat the whole list of points and that& #39;s make sense accordingly to what the docs says
for the triangles, I had to repeat the whole list of points and that& #39;s make sense accordingly to what the docs says
but, the last tricky thing was about the endShape(CLOSE). when I changed my 4-vertex shape code to iter over all the points, I ended up with a straight line on top of the curved shape. to fix that, you just have to remove the CLOSE
#processing #creativecoding
#processing #creativecoding