Great explanation, thanks.
So, in that example I don't think the texture code should be there. No
texture is ever loaded.
Cory
Vincent Bourdier wrote:
Hi Cory,
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.
Hope this will help you.
Regards,
Vincent.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
|
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org