• Advertisement

Archived

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

calculating normals

This topic is 6323 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 use a height-field to represent a landscape. How can I calculate the normal vectors from this data?

Share this post


Link to post
Share on other sites
Advertisement
the same as with any model
take 3 points (a,b,c) of a quad,tri from the landscape
p = b - a;
q = c - a;
normal = crossproduct(p,q)
normalize(normal)

this''ll give u the planes normal for the tri.

step 2 to make it smoother take a landscape point see what other tris/point share this point add up all their normals add divide them by the number of tris. repeat with all the landscape points

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
zedzeek is right , but after adding all plane (polygon) normals, it''s better to normalize then to divide by the number of planes.

Common mistake I''ve made so often myself - I lost count.

Share this post


Link to post
Share on other sites

  • Advertisement