Tracygo
11-23-2003, 09:05 AM
is there anyone could tell me what is this "length argument"? And what does (Glfloat length) mean, I mean why not a number? Thanks a lot
//Joint part - consists of a Sphereand and a streched cube which is controled by the length argument//
void jointShape (GLfloat length)
{
glColor3f(0.0, 0.0, 1.0); //Sphere color
glPushMatrix ();//save position
glTranslatef (-length/2, 0.0, 0.0);//
glutSolidSphere(0.8,40, 40);
glTranslatef (length/2, 0.0, 0.0);
glColor3f(0.0, 1.0, 0.0); //cuboid color
glScalef (length, 1.0,1.0);//
glutSolidCube (1.0);
glPopMatrix ();
}
//Joint part - consists of a Sphereand and a streched cube which is controled by the length argument//
void jointShape (GLfloat length)
{
glColor3f(0.0, 0.0, 1.0); //Sphere color
glPushMatrix ();//save position
glTranslatef (-length/2, 0.0, 0.0);//
glutSolidSphere(0.8,40, 40);
glTranslatef (length/2, 0.0, 0.0);
glColor3f(0.0, 1.0, 0.0); //cuboid color
glScalef (length, 1.0,1.0);//
glutSolidCube (1.0);
glPopMatrix ();
}