#### Archived

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

# Auto calculating normals...

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

## Recommended Posts

Hi. Is there any function in OpenGL or otherwise to dynamically calculate normals? Im currently working on a terrain height map based engine with texturemapping using a viewing range of around 20x20 quads. Each time the position of the camera changes from one square on the heightmap to another, the normals for the new quads that just came into range need to be (re)calculated. As there can be mountains and vallies, the polygons can be facing nearly any direction when we load them off of the height map, so they need to be calculated each time a new section of the map comes into view to ensure that the lighting comes out right. I cant statically assign them normals, as the map is dynamically generated using a fractal terrain generator each time. As the resulting map is so insanely huge, I cant even calculate the normals once, and then load them in when need be because of memory concerns. Right now I have a lot of long strung out equations calculating the normals, but I was wondering if OpenGL had any facilities built into it to automatically calculate the normals. I dont really see why it wouldnt, but then again I dont really see why it would. So I figured I might as well ask. Any help on this would be greatly appreciated. ~Elig

##### Share on other sites

http://nate.scuzzy.net/docs/normals/

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/

##### Share on other sites
http://www.opengl.org/developers/code/mjktips/grid/

But it won''t be any faster than if you did it yourself. If you calculate your own normals, you have the ability to do some tricky stuff like normal averaging and animation.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631428
• Total Posts
3000027
×