PDA

View Full Version : Normals



McZ
12-20-2000, 01:01 AM
Hi! there is one thing I donīt get. do I need to calculate the face/vertex normals every frame or can I calculate them at start of the program and put them in a lookup table ?

Eric
12-20-2000, 01:13 AM
If the object you display does not change (i.e. it is a static mesg), its normals don't change either... You can then calculate all normals once for all !

Regards.

Eric

McZ
12-20-2000, 01:27 AM
so if I have a cube that alwas would be a cube I could calculate the normals at the start of my program http://www.opengl.org/discussion_boards/ubb/smile.gif but if I have a cube that will morph into a pyramid or somthing I have to recalculate the normals right ? http://www.opengl.org/discussion_boards/ubb/smile.gif

Eric
12-20-2000, 01:52 AM
Yep, you got it !

Regards.

Eric

Tim Stirling
12-20-2000, 09:25 AM
all moving objects will also need to have their normals recalculated

pleopard
12-20-2000, 09:39 AM
Originally posted by Tim Stirling:
all moving objects will also need to have their normals recalculated

Not necessarily so...

If you move your objects with glTranslatex(...) then the normals do not have to be recomputed.

If you have an object whose geometry changes with time then you may need to recompute the normals. However, for non-changing geometries, a single calculation is all that is necessary.

Eric
12-20-2000, 11:02 PM
Originally posted by Tim Stirling:
all moving objects will also need to have their normals recalculated

I know pleopard answered this, but I want to insist...

NO, NO, and NO : YOU DON'T HAVE TO RECALCULATE YOUR NORMALS IF THE MESH IS STATIC !!!!!

Even if you rotate/translate it, you don't have to recalculate them... Actually, even if you scale it, you have nothing to do (except using glEnable(GL_NORMALIZE) !).

You have to recalculate the normals only if you change the mesh.....

Regards.

Eric