Can someone please tell me how to simplifying this without reverting to me creating a scenegraph?
What do you guys think?
http://members.optusnet.com.au/ksaho/work/ComputerGraphics/assignment2/Robot.exe
keys 0-9 to move joints
What do you guys think?
http://members.optusnet.com.au/ksaho/work/ComputerGraphics/assignment2/Robot.exe
keys 0-9 to move joints
Code:
void Render::drawObjs()
{
glEnable(GL_LIGHT0);
glLightf(GL_LIGHT0, GL_AMBIENT, 0.6f);
glPushMatrix();
{
drawHead();
glTranslated(0, -1.5, 0);
glPushMatrix();
{
drawNeck();
glTranslated(0, -1.5, 0);
glPushMatrix();
{
drawTorso();
glPushMatrix();
{
glTranslated(.6, .4, 0);
drawJoint();
glPushMatrix();
{
glTranslated(1, -2, 0);
drawArm();
glPushMatrix();
{
glTranslated(.2, -.6, 0);
glScaled(7, 1, 1);
drawJoint();
}
glPopMatrix();
}
glPopMatrix();
}
glPopMatrix();
glPushMatrix();
{
glTranslated(-0.6, .4, 0);
drawJoint();
glPushMatrix();
{
glTranslated(-1, -2, 0);
drawArm();
glPushMatrix();
{
glTranslated(-.2, -.6, 0);
glScaled(7, 1, 1);
drawJoint();
}
glPopMatrix();
}
glPopMatrix();
}
glPopMatrix();
}
glPopMatrix();
}
glPopMatrix();
}
glPopMatrix();
}