using c# and vector math. In this video I procedurally generate a cube mesh of desired size and resolution by manipulating a plane mesh in 6 different ways. I also show how I can turn this cube into a sphere by manipulating the vertices. As an extra I do some linear interpolation between both sets of values to morph between cube and sphere as desired.
While it gets the job done, the downside to this approach is that there are some repeated vectors on the edges of the planes, which can make it confusing to alter since moving a vertex might not change all triangles visually connected to that point since they may be connected to another point at the same position instead.
Disclaimer: this is just one way to draw a cube. I am hoping to explore other ways to draw a cube in the future while exploring mesh world and 3d rotations.
Plane mesh generation tutorial:
[ Ссылка ]
Mesh Renderer playlist that builds up to this:
[ Ссылка ]
Full script can be found here:
[ Ссылка ]
0:00 overview of approach
0:08 drawing the cube
0:43 dimension switch
1:07 turning cube into sphere
#unity #procedural #mesh #generation #tutorial
Ещё видео!