View Full Version : face normals or vertex normals
02-20-2004, 09:21 PM
I have a smal doubt. I'm using vertex arrays in my program and i use the glNormalPointer() to specify the normals. My program runs fine but the object is not affected by the light. I have given an array of face normals to the function glNormalPointer(). Should i give it vertex normals? how do i calculate the vertex normals if so?
better still, is there any software or utility that imports a model and tells us the vertex positions as well as the normals for each vertex?
02-20-2004, 09:32 PM
then youre in trouble. the same index is used for everything, so the 5th vertex will use the 5th normal. calculating the vertex normal means either averaging the surrounding face normals or duplicating the vertex (for sharp edges etc. you dont want an average).
im more or less sure that most 3d modelling programs will give you per vertex normals or maybe even both. if not, you get all the extra info you often dont want (edges, neighbours, etc.) and can use that to calculate average normals.
but i really begin to wonder what kind of questions are asked in the beginners section.
02-20-2004, 10:06 PM
could you tell me how i can find the vertex normsls in 3d studio max or in maya? I have access to these packages but i don't know how to find the component details,i.e vertex positions and vertex normals.
02-21-2004, 03:51 AM
There are plenty open source 3ds loading libraries floating around. Have a look at one of them - they always have normal computing routines.
02-21-2004, 06:29 AM
The Max SDK has lots of examples on how to export, and how to calculate normals. Just search the help file.
Also, the Max SDK comes with an IGameExporter interface that's ideal to build exporters on top of.
Check it all out at sparks.discreet.com. Now, moderator please close this thread that has nothing to do with OpenGL?
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.