Jump to content
  • Advertisement
Sign in to follow this  
chosendl

Surface normals

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

OK I want to calculate the vertex normals on my hexagonal terrain using a height map. I think that in order to do this, i need to calculate the surface normal of each of the 6 triangles that a vertex touches and then average their normals to create an average vertex normal, where the 6 triangles meet. I may be wrong in my method here, i am new to this. If anyone has a better idea, please tell me. Also how do i find a surface normal in vb.net, im sure there must be some kind of built in function for this. Thanx in advance!

Share this post


Link to post
Share on other sites
Advertisement
If you would have a square-based terrain, the equation would look like this:
normal.x=height(x-1,z)-height(x+1,z);
normal.z=height(x,z-1)-height(x,z+1);
normal.y=2;
normalize(normal);
(this is the average of the normals of the triangles that contain the point. Surprisingly simple.)
The hexagonal thing should be really similar, but not axis-aligned.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!