Monday, March 19, 2007

Chales,,,
forgot to give you all the code, well here is what I added to the robot proyect to draw the blasting hand:

void DrawPalm(float xPos,float yPos,float zPos)
{
glPushMatrix();
glColor3f(1.0f,0.0f,0.0f);
glTranslatef(xPos,yPos,zPos);
glScalef(4.0f, 4.0f, 1.0f);
DrawCube(0.0f, 0.0f, 0.0f);

glPopMatrix();

}
void DrawFinger(float xPos, float yPos,float zPos)
{
glPushMatrix();
glColor3f(1.0f,1.0f,1.0f);
glTranslatef(xPos,yPos,zPos);
glPushMatrix();

glScalef(0.5f, 2.0f, 1.0);
DrawCube(0.0f, 0.0f, 0.0f);

glPopMatrix();
glColor3f(0.0f,1.0f,1.0f);
glTranslatef(0.0,0.5,zPos);
glPushMatrix();
glScalef(0.5f, 0.5f, 1.0f);
DrawCube(0.0f,0.0f,0.0f);
glPopMatrix();
glColor3f(1.0,0.0,1.0);
glTranslatef(0.0,0.5,zPos);
glPushMatrix();
glScalef(0.5f, 0.5f, 1.0f);
DrawCube(0.0f,0.0f,0.0f);


glPopMatrix();
glPopMatrix();

}
void DrawThumb(float xPos,float yPos,float zPos)
{
glPushMatrix();
glColor3f(1.0f,1.0f,1.0f);
glTranslatef(xPos,yPos,zPos);
glPushMatrix();
glScalef(2.0f, 1.0f, 1.0f);
DrawCube(0.0f, 0.0f, 0.0f);

glPopMatrix();
glColor3f(0.0f,1.0f,1.0f);
glTranslatef(1.0,0,zPos);
glPushMatrix();
glScalef(1.0f,1.0f,1.0f);
DrawCube(0.0f,0.0f,0.0f);
glPopMatrix();
glColor3f(1.0,0.0,1.0);
glTranslatef(0.5,0,zPos);
glPushMatrix();
glScalef(0.5f,1.0f,1.0f);
DrawCube(0.0f,0.0f,0.0f);


glPopMatrix();
glPopMatrix();
}
void DrawHand(float xPos,float yPos,float zPos)
{
//DrawHand();

DrawPalm(10.0f,2.0f,0.0f);
DrawFinger(10.0f,4.0f,-1.0f);
DrawFinger(9.0f,4.0f,-0.5f);
DrawFinger(8.0f,4.0f,-0.5f);
DrawFinger(7.0f,4.0f,-0.5f);
DrawThumb(12.0f,-1.0f,-2.0);
}

No comments: