#Creating a sparkle shape
1 messages · Page 1 of 1 (latest)
By using shapes and extruding them
There is an official three example using a formula (line 137) to generate star shaped geometry. It take Math.PI to draw points then Math.cos Math.sin to alternate the distance from the center.
https://threejs.org/examples/?q=shape#webgl_geometry_extrude_shapes
to draw your sparkle, you need less points/branches numPts = 4; and could use ovals instead of circles for the distances
TBF that's for an extruded version of the 2d shape; if OP wants a truly 3d version (for instance, with points along all three axes) that's going to be a bit trickier. Somthing similar could work, though: take the vertices of a cube, then add one vertex in the middle of each face at a much greater distance from the center.
there would be 6 points on the 3d space. I'll try that. i don't see the code on your example link, where is it?
you can click bottom right there is a (very subtle) button on every example to display the github source
oh thanks i didn't know that
Why do you want the sparkle shape to be 3D? "Sparkles" are two-dimensional optical artifacts. Not sure what you're going for, but here are some sparkly stars in 3D space that I used THREE.Points to create. The "sparkles" themselves are 2D billboards, though, which is more or less true to reality, as the "sparkle" only exists on the surface of the optical sensor.