View Full Version : texture coordinate?
03-29-2005, 10:47 PM
I want to ask about when we make texture coordinate as this follows:
what is the meaning of the GL_TRIANGLE_STRIP in the line glBegin()?
GL_TRIANLGE_STRIP treats the vertices as connected triangles, which means you can specify triangles with as few points as possible.
E.g. you can specify 3 triangles with just 5 vertices:
(The numbers represent the vertices, the letters represent the surfaces)
You need to specify a separate texture coordinate per vertex (before the glVertex call), otherwise you'll get the same texture coordinates for all vertices.
The one place where strips and fans have an influence on texture coordinates is that vertices are shared, which also means texture coordinates are shared - so you can't make a split when you use strips.
In the example above, vertex 3 has the same texture coordinates, whether you look at plane A or B or C. There are two ways to split them:
1. use GL_TRIANGLES and specify 3 coordinates per triangle
24---68 ... etc
2. use multiple strips
\A/B\\C/ . ... etc
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.