Normals

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 ?

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

so if I have a cube that alwas would be a cube I could calculate the normals at the start of my program but if I have a cube that will morph into a pyramid or somthing I have to recalculate the normals right ?

Yep, you got it !

Regards.

Eric

all moving objects will also need to have their normals recalculated

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.

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