I’m building a surface of revolution by the formula. How do I get or calculate the texture coordinates? (No matter how the texture will be applied, whatever way is needed)
Colculated the indices of the vertices of triangles
Calculated normal
The figure displayed on the screen. There are lights in the figure, but have no idea how to build texture coordinates.
For mathematically-generated surfaces, the texture coordinates are usually derived directly from the parameterisation of the surface. A surface of revolution is typically parameterised by the rotation angle and the distance along the axis, i.e. it’s effectively a deformed cylinder defined by <x,y,z>=f(angle,distance).