Jump to content
  • Advertisement

Archived

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

laeuchli

normals

This topic is 6517 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 have my hieght map, and it''s rendering ok. However, I need to know how to generate normals for my landscape. Could someone please help out? Thanks, Jesse www.laeuchli.com/jesse/

Share this post


Link to post
Share on other sites
Advertisement
The cross product of two vectors created from the sides of a triangle gives the normal for the triangle. Pick the correct sides or you get the opposite direction.

One way to get your vertex normals is to sum the normals of all triangles that use that vertex. Then normalize the result.

If using Directx, the utility functions in D3DXMATH.H make things really easy.

Seedload

Share this post


Link to post
Share on other sites
The right hand rule, I think. Stick you hand out and put your thumb up. Your thumb is the desired normal and the wrapping of your fingers tells you the order to use the sides: counterclockwise.

I think that''s right.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!