Jump to content
  • Advertisement


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


calculating terrian normals

This topic is 5615 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

Hi there! Does anyone know a fast way to calculate terrian normals? I want to page in patches of terrain on the fly from the raw height data. This would involve calculating the normals along with the vertex positions and texture coords. Surely there must be an approximation of the normals based on the relative heights of the neighbouring vertices rather doing many cross products. Thanks in advance!

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
you can find the formula in any calculus book in the chapter about partial derivatives and surfaces..

in case not, the idea is:

cross(h[x+1,y]-h[x-1,y], h[x,y+1]-h[y-1]);

you can simplify it a bit as you see when you write the whole thing out..

maybe this will get you a reverse normal, if so just negate it.

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!