Quote:
Originally Posted by flamingliquid
Ok, so I am just trying to teach myself OpenGL ES, and have a couple of roadblocks. They seem so simple, yet so difficult at the same time. One of which has to do with Normals.
I have a GLfloat array of vertices created from an OBJ file. In order for the lighting to work, I need normals.
How can I calculate normals based on the array of GLfloats?
Thanks.
|
You can't.
You can only calculate normals for triangles which means you will have to know which of these floats are connected together to form triangles ( normally you would get that from indices)
Once you have your triangle data you can just simple look it up on the net.
Calculate the normal of a triangle with three vertices - XNA Community Forums