Sign in to follow this  
apprentice

normals for lighting when using triangle strips

Recommended Posts

I am trying to set up a point light(D3DLIGHT_POINT). As far as I know my vertices need to have normals that show which direction is perpendicular to the triangle the vertices are part of. Here's my problem: I want to use triangle strips and normals. Each vertex will be part of several polygons that all have their individual orientations, right? How do I decide which one the vertex is going to use? Maybe it isn't appropriate to use strips in this situation, but I read that they are faster so I want to use them if possible. I hope that it is clear what my problem is and that I provided enough information. EDIT: changed vertexes to vertices, I demonstrated that I am a newbie again, sorry [Edited by - apprentice on November 25, 2004 1:58:00 PM]

Share this post


Link to post
Share on other sites
If you want objects to appear curved, or smooth, like a sphere, you use the average normal of all the faces that share the vertex. If you want your object to appear hard edged like a cube, you need to create new vertices that have the same position, but have differing normals.

Share this post


Link to post
Share on other sites
If you have a triangle, you should have 3 normals for each of the verts. All of them will point in the same direction to find there normal, build two vectors from point a-b and a-c and take the cross product of the two vectors.

Do that for all vertices in the mesh, and then take all normals that share a vertex and average them, to give a smooth rounded look like namethatnobodyelsetook already mentioned.

-Dave Neubelt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this