PDA

View Full Version : Coordinates of textures

Sergio007
10-21-2016, 09:09 AM
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.

uwi2k2
10-21-2016, 11:38 AM
hi there,

To understand opengl textures you may start here:
http://www.opengl2go.net/2015/10/29/published-008-textures-lets-get-started/

regards
kai

GClements
10-21-2016, 01:04 PM
I'm building a surface of revolution by the formula. How do I get or calculate the texture coordinates?
However you like.

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).