I have successfully created a free-hand drawing sketchpad in threeJS with the ability to draw shapes. My next step involves utilizing simplify-JS to simplify the points in my polygon. One issue I am facing is that I am passing my array as buffer geometry and using Line Mesh to display it on screen. The array is structured like [x,y,z,x,y,z,x,y,z... and so on], with a maximum of 10000 points as an example.
Vertices[0.555,0.323,298,0.585,0.353,298,0.615,0.373,298...continuous].
Now, I am looking for a way to convert these vertices into an object format like:
Vertices[{x:0.555,y:0.323,z:298}, {x:0.585,y:0.353,z:298},{x:0.615,y:0.373,z:298}]
...and so on for the entire length of Vertices.
Thank you in advance.