normals for GL_TRIANGLE_STRIP
I know how to do normals for quads and triangles, but what about triangle strips? especially when the two triangles that follow each other aren''t located in the same plane?
the order of vertices supplied for a triangle strip...as you should know is
tri 1 : v0 v1 v2
tri 2 : v2 v1 v3
know for each triangle get the crossproduct of 2 vectors and probably normalize the result, there you have the normals you''re looking for
If you need per vertex normals just average the normals for the faces that are sharing the vertex.
tri 1 : v0 v1 v2
tri 2 : v2 v1 v3
know for each triangle get the crossproduct of 2 vectors and probably normalize the result, there you have the normals you''re looking for
If you need per vertex normals just average the normals for the faces that are sharing the vertex.
---sorry for not using proper english , I'm from latin roots
my question is: where to place glNormal3f calls?
glBegin(GL_TRIANGLE_STRIP);
//Normal for first triangle
glVertex3f(*, *, *); //vertex 0
glVertex3f(*, *, *); //vertex 1
glVertex3f(*, *, *); //vertex 2
//should I add glNormal3f call for the second triangle here?
glVertex3f(*, *, *); //vertex 3
glEnd();
thx
Another question:
glEnable(GL_NORMALIZE) makes OpenGL automatically calculate normals , right?
glBegin(GL_TRIANGLE_STRIP);
//Normal for first triangle
glVertex3f(*, *, *); //vertex 0
glVertex3f(*, *, *); //vertex 1
glVertex3f(*, *, *); //vertex 2
//should I add glNormal3f call for the second triangle here?
glVertex3f(*, *, *); //vertex 3
glEnd();
thx
Another question:
glEnable(GL_NORMALIZE) makes OpenGL automatically calculate normals , right?
First part yes second part no.. GL_NORMALIZE normalizes normals passed to glNormal3f I believe.. (making them unit vectors)
[edited by - uber_n00b on August 16, 2003 5:49:28 PM]
[edited by - uber_n00b on August 16, 2003 5:49:28 PM]
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement