"Smoothing" normals for terrain

Started by
2 comments, last by _goat 21 years, 3 months ago
All right. So I''ve created a stupid array of triangles, and render them (DX8.1). I have normals, however the normals for each triangle are all the same, so I have sharp angles of light between each triangle. Firstly, what is the math (and small explanation in implementation) to make each normal the average of the ones around it? Secondly, this is a "stupid" terrain. Any help with better implementations (index buffers, other stuff which I''ve read around here) would be very helpful, because I''ve yet to find an article that helps with terrain implementation. - Cheers I''''m not easily impressed. Ooh! A blue car!
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
Advertisement
say three triangles share one vertex, that vertex has three normals...

a quick-and-easy way would be to take the numerical mean of the components of each vector [(x1+x2+x3)/3,(y1+y2+y3)/3,(z1+z2+z3)/3] then normalise

********


A Problem Worthy of Attack
Proves It''s Worth by Fighting Back
spraff.net: don't laugh, I'm still just starting...
secondly: assuming you''ve a heightmap for your terrain, it''s very easy to make triangle strips of it. just make a triangle strip of each row. don''t store the vertex data in an additional structure for the triangle strips but store the vertex indices...

GA
Visit our homepage: www.rarebyte.de.stGA
Yeah. I could have done it in triangle strips. But I just read up on index buffers, and they seem to be the way for terrain and sky (where both are textured).

And thanks for the maths.

I''''m not easily impressed.
Ooh! A blue car!
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]

This topic is closed to new replies.

Advertisement