Sign in to follow this  
HeartFlowing

How to use face-normal of a mesh

Recommended Posts

here is a mesh: 1.vertex data array 2.texture coordinate array 3.face normal array:with 3 index of vertex, and 1 face normal how do I use 'glDrawElements()'to display this mesh?? someone's suggestion: 1.convert the face-normal to vertex normal : just add all face-normals of each vertex(means faces indexing the vertex) and normalize, than I can get vertex-normal but, here is a problem: if a plane is 'with two face lighting', then a vertex of the plane may have two opposite normal which form a ZERO-normal(error occur). and some other problems. 2.copy out all the vertices occording to the faces. copy three vertices occording to each face's three indices, then evaluate these three vertices with the same normal of the face. and now we use glDrawArray() insteading of glDrawElements() PS:maybe I have not described precisely. but do help me!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this