Sign in to follow this  
cyanbeck

Problem about Quadric Sphere normals

Recommended Posts

cyanbeck    122
I use display lists and gluSphere to draw a human body which is loaded from a bvh file. Because bvh is a hierarchy format, the drawing code is written as a recursive function. Anyway, the code of drawing a bone looks like as follows:
glPushMatrix();
glRotated(t, localOffset[2], 0, -localOffset[0]);
mBoneMat.apply();
i = bodypart->GetID();
glCallList(mLists[i]);
glPopMatrix();

And the code of setup display lists is as follows:
glNewList(list, GL_COMPILE);
glScaled(width, length / 2, width);
glTranslatef(0, 1, 0);
gluSphere(mQuadricObj, 1, 10, 10);
glEndList();

Then here is the result: As you can see, the body is composed of many spheres. But the problem is, normals of some spheres are correct, while otheres are wrong. Ex. Each limb is dark. Any idea about what the problem is would be appreciate. ps. The white ball represents the light source.

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