I need an algorithm that generates meshes at run-time of cylinders and spheres (one for each of them). I've been searching but I can't seem to find one that supports what I need or that I can truly understand.
Mesh attributes:
- Vertices: Position, Normal and Texture Coordinates
- Indices
Cylinder arguments: Height, bottom radius, top radius, stacks (sections along height), slices (parts per section)
Sphere arguments: Height, bottom radius, top radius, stacks (sections along radius), slices (parts per section)
There's no need for Object Oriented Programming. An array of floats for each of the vertices attributes and an array of integers for the indices is sufficient.