• Advertisement

Archived

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

normals

This topic is 6251 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
ok, thats what I''m doing wrong. I''m picking the wrong sides. How do I tell which order to pick which sides??

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