#### Archived

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

# calculating normals

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

## Recommended Posts

I use a height-field to represent a landscape. How can I calculate the normal vectors from this data?

##### Share on other sites
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 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.

• 9
• 10
• 9
• 48
• 12
• ### Forum Statistics

• Total Topics
631387
• Total Posts
2999712
×