Archived

This topic is now archived and is closed to further replies.

glUser3f

normals for GL_TRIANGLE_STRIP

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
quote:
Original post by uber_n00b
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]

ok thx

Share this post


Link to post
Share on other sites