You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Draw a shape with vertexProperty between each vertex
Make sure you pass a single value as the property (e.g. 0) as opposed to an array (e.g. [0])
This throws the error Error: Can't convert 0 to array!. If you use an array, there is no error. It should be converting to an array under the hood, but I must have messed that up in the shapes refactor.
Snippet:
functionsetup(){createCanvas(400,400,WEBGL);constpts=[]for(leti=0;i<50;i++){pts.push(createVector(random(width),random(height)))}constsnake=buildGeometry(()=>{noFill()beginShape()for(const[i,{ x, y }]ofpts.entries()){vertexProperty('length',i/(pts.length-1))splineVertex(x,y)}endShape()})}
Most appropriate sub-area of p5.js?
p5.js version
2.0 beta 1
Web browser and version
Firefox
Operating system
MacOS
Steps to reproduce this
Steps:
vertexProperty
between each vertex0
) as opposed to an array (e.g.[0]
)This throws the error
Error: Can't convert 0 to array!
. If you use an array, there is no error. It should be converting to an array under the hood, but I must have messed that up in the shapes refactor.Snippet:
Live: https://editor.p5js.org/davepagurek/sketches/YPu6ixNV5
The text was updated successfully, but these errors were encountered: