View Full Version : what is glNormalf ?
Sorry for my English. U hope you'll understand something.
What is normalie? As I realy should use glNormalf to make my polygons look correctly or it can be done automaticaly by using something. And what is glEnable(GL_NORMALIZE) how it change my polygons
02-05-2006, 05:57 PM
glNormalf is a command for establishing the normal of the polygon you are going to draw next.
In other words you should call it before drawing each polygon.
Once you use lighting in OpenGl you'll have to use normals. Without normals opengl doesnt know how to shade.
Either you can manually calculate the normals (vector math) or you can load them from a program that already calculates them, for example 3d studio, etc. However you'll have to code a way to parse a 3d studio file.
glEnable(GL_Normalize) normalizes the normal vectors for you with a small performance hit. Normals should be normalized (that is norm =1 ), if not shading looks bad.
I hope you get the idea.
02-05-2006, 11:10 PM
The normal points in the direction of the "surface" of the polygon, if you want to calculate it yourself you use something called Cross product (http://en.wikipedia.org/wiki/Cross_product)
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.