🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

can opengl automaticly work out Normals?

Started by
11 comments, last by Zerosignull 24 years ago
ive been lookin at me prog wondering if opengl can create the normals for vextors. i know theres a AUTO_NORMAL glbegin routine and normalise. how do i use them? ~prevail by daring to fail~
Advertisement
I''m preety sure you have to work out the normals yourself except with NURBS.

ECKILLER
ECKILLER
use glEnable(GL_CULL_FACE);

There is functionalty for doing automatic normals... but 99 times out of a 100 it will give you some realy funky results....

To say that it''s unpredictable is an understatement.



==============================
"What if Bill Gates hade a penny everytime windows crashed?
Oh wait, he does!"
-Dont know who said that, but it's funny :)

-Joacim Jacobsson

=============================="What if Bill Gates hade a penny everytime windows crashed? Oh wait, he does!"-Dont know who said that, but it's funny :)-Joacim Jacobsson
thanks.

~prevail by daring to fail~
Actually, I haven''t had problems with it giving me funky results, it just does per-vertex normals (not per-polygon) so you don''t get distinct edges on objects (which makes things look odd). Just for reference, the function is glEnable( GL_NORMALIZE ).

Morgan
Morgan, that only makes opengl recalculate any normals you supply that are not unit vectors to unit vectors (ie. their length is 1). It does not generate automatic normals. It also slow''s down openGl performance a bit, so you should avoid using it...

==============================
"What if Bill Gates hade a penny everytime windows crashed?
Oh wait, he does!"
-Dont know who said that, but it's funny :)

-Joacim Jacobsson

=============================="What if Bill Gates hade a penny everytime windows crashed? Oh wait, he does!"-Dont know who said that, but it's funny :)-Joacim Jacobsson
i thought that glEnable(GL_NORMALIZE); was the normalize the normals to unit vectors. and glEnable(GL_AUTO_NORMAL); was to automatically setup normals. i think that''s it.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
i thought that glEnable(GL_NORMALIZE); was the normalize the normals to unit vectors. <--- that was what I was trying to say

Dont know about the GL_AUTO_NORMALS, i think you are right on that one but I cant find anything in the red book on the subject...



==============================
"What if Bill Gates hade a penny everytime windows crashed?
Oh wait, he does!"
-Dont know who said that, but it's funny :)

-Joacim Jacobsson

=============================="What if Bill Gates hade a penny everytime windows crashed? Oh wait, he does!"-Dont know who said that, but it's funny :)-Joacim Jacobsson
Ah, yeah, GL_AUTO_NORMAL must have been what I was thinking of, and no I don''t actually use it (I calculate them on the fly when I first load my models). If you want a good source for learning to calculate normals for polygons then check out Nate''s site (nate.scuzzy.net).

Morgan

This topic is closed to new replies.

Advertisement