Texture coordinates is a basic way to apply a texture on a geometry. For each vertex, you give a 2D coordinate data to associate a vertex and a texture point. OpenGl will interpolate the texture pixel between each vertex, depending on theses coordinates. The 2D texture coordinate have to be like this in your texture image: [0,0] [1,0] |------------| | | | | | | | | |------------| [0,1] [1,1] In your example, with a single file of texture, you set the texture for each side. For each texture you set in OSG, you can set a texCoordinateArray. The index you set pyramidGeometry->setTexCoordArray(*0*,texcoords); correspond to the texture index you set before, when setting the texture. Have a look on Texture coordinate on the web, you'll find a lot of explanations.
what is setTexCoordArray
最新推荐文章于 2023-12-17 00:05:51 发布