Jump to content
  • Advertisement
Sign in to follow this  
apprentice

normals for lighting when using triangle strips

This topic is 4956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!