Problem with Normals

Started by
4 comments, last by valg3 22 years, 10 months ago
I''ve recently created a fractal terrain generator using a series of triangle strips lined up right beside one another. I certain that I calculated the normals for the face of each triangle correctly, but maybe I''m wrong. Though it does shade the landscape, the shading is in such a way that the strips are very visible. Take a look: http://www.geocities.com/diatan/fractal_filled.jpg Can anyone tell me how to fix this problem? Should I go further than calculating the normal for each triangle and figure out what the normal is for each vertex instead? Or should I use GL_TRIANGLE instead of strips and draw each one individually? Any suggestions are appreciated. Thanks
Advertisement
defintly wrong normals
i recommend start off simple calculate one normal per face + dont use strips.
once youve got that sussed try a normal per vertex. and then later use strips as well

http://members.xoom.com/myBollux
When i look on the picture, i would say, you have calculated the vertex normals
but only in one direction. (every stripe)

Check your code for calculating the normals.
how to compute nomals at each vertex:
first pass on triangles
compute a normal for each triangle of the whole mesh

second pass on each vertex:
for any given vertex, find out wich triangles are incident to the vertex, and compute the weighted average of the three triangle''s normals, and assign it to the vertex. Use the angle of each triangle at the vertex as coefficient in the wheighted average.

a bit boring bu it looks so good.
yvo
I recomend checking out this site amir.cfxweb.net !!

He has some really great tutorials on normals and vector math!!
Helped me out when having the same problem as you got!!

if you check my site i made a little prog that calculates the
normal in tris. in different angles!! You can download it
with the source!! (Wacky FPS demo)!!!

http://home.no.net/cybertux
Hope this helps...

Take Care!


- -- ---[XaOs]--- -- -


Edited by - XaOs on June 28, 2001 7:26:08 PM
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]
Cool, thanks. I''ll check those out. I almost forgot to post that I finally figured out the vector math for it and its looking great so far :-)

Thanks again for all the help.

This topic is closed to new replies.

Advertisement