Place nodes at regular intervals

Share on Twitter Share on Facebook Share on LinkedIn

Place nodes at regular intervals

Description

If we want to place nodes an equal distance apart from a central point (for example the world origin), we can use some maths to determine the positions of those nodes as we would the cordinates of vertices of an n sided polygon with a known radius.

For example, if we had 3 items we wanted to position around the user they would be at the 3 points of a triangle, 4 points a square, 5 points a pentagon etc

What if there are 40 items you want to place around the user at regular intervals? Then we need to calculate the position of the vertices of a 40 sided regular polygon. As can be seen in the video and code below.


Video


Code


Next Step : Use physics in scene

After you have mastered this you should try Use physics in scene