Advertisement

Triangle Strip Normals.

Started by March 30, 2002 07:11 AM
11 comments, last by djdynamic 22 years, 11 months ago
How do you specify normals for the triangles in triangle strips? E.g. do you do point point normal point normal point ......... or what ? Thanks.
You specify normals for each vertex, not for each triangle.
---visit #directxdev on afternet <- not just for directx, despite the name
Advertisement
Normals are specified per vertex. For a start, you specify the normal BEFORE the vertex.

normal 1
vertex 1 (uses vertex 1)
normal 2
vertex 2 (uses normal 2)
vertex 3 (uses normal 2)

For a huge performance increase, look into vertex arrays (use google or MSDN).


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
but then wouldnt 2 verts be short of a normal.... ?
because like first vertex normal would be made of 1st 2nd 3rd... and 2nd normal would be made of 2nd, 3rd, 4th.. and so on.. but what about last and second last....
siaspete, could u please give me an example using 5 verts? thanks.
normal 1
vertex 1 (uses normal 1)
normal 2
vertex 2 (uses normal 2)
normal 3
vertex 3 (uses normal 3)
normal 4
vertex 4 (uses normal 4)
normal 5
vertex 5 (uses normal 5)

remember normals are PER VERTEX (not per face)..

look at it this way : OpenGL is a state machine. you set a normal. this is just some state for lightning and stuff like that to use. Then every vertex you send to card will use this normal until you change it.

There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
Advertisement
I totally understand that u have to specify a normal first then the vertex... and i understand how noramls work with triangles, quads, polys, etc, but not with triangle strips...
How can each vertex have it''s own normal!?!? because to make a normal u need 3 points, which u make 2 vectors out of... so 2 of the points in a triangle strip wont have a normal.... right ? or what ? I dont see how this works... :/
Normal for a vertex can be found by averaging normals for faces that include this vertex. Of course, you need to calculate face normals before this.
---visit #directxdev on afternet <- not just for directx, despite the name
Ahhh... Well that sounds fun.... Ill go look it up, thanks for pointing me in the right direction.
Imagine a normal sticking out of each vertex. This allows triangles to APPEAR curved, even when they''re not.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

This topic is closed to new replies.

Advertisement