Example #1
0
/*	void drawHelicopter()
	This function holds all the creation of 
	the parts of the helicopter
*/
void Model::drawHelicopter() {
	glPushMatrix();
		setPosition();
			drawEngine();
			drawTailConnect();
			drawTail();
			drawBody();

		glPopMatrix();		// Last pop containing the helicopter
	glPopMatrix();
}
Example #2
0
void PatBike::draw()
{
    setMaterial();
    if (isJousting)
    {
        joust();
    }
    else
    {
        move();
    }
     glPushMatrix();//BIKE

        glTranslated(bikePosX, 0.28, bikePosZ);
        glRotatef(heading, 0, 1, 0);
        
        glScalef(0.5,0.5,0.5);
        tm->BindTextureByIndex(2);   
        drawEngine(0.55, 0.45, 0.50, 0.4, 0.75);
        glDisable(GL_TEXTURE_2D);

        glPushMatrix();// Connect Front2Back
            glColor3f(0.6, 0.6, 0.65);
            glTranslatef(0.55, 0, 0);
            glRotatef(90, 0, 1, 0);
            glRotatef(-70, 1, 0, 0);
            drawCylinder(0.075, 0.075, 1.25, 75, 75);
        glPopMatrix();

        glPushMatrix();// Gas Tank

            glColor3f(0.4, 0.2, 0.2);
            glTranslatef(-0.6, 0.35, 0.0);
            glScalef(0.62,0.42, 0.42);
         //glEnable(GL_TEXTURE_2D); 
         //   glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 
         //   glBindTexture(GL_TEXTURE_2D, texture[5]); 
            
            tm->BindTextureByIndex(5);   
                glutSolidCube(1.0);
            glDisable(GL_TEXTURE_2D);
        glPopMatrix();
                
        drawSeat();

        glPushMatrix();
            drawTrailerHitch();
        glPopMatrix();
        
        //Draw the lower back frame
        drawBottomBackFrame();

        glPushMatrix();
            glTranslatef(-1.4, 0, 0.0);
            drawTire(11);
        glPopMatrix();				

            //Start front frame
        glPushMatrix();
            glTranslatef(1.7, 0, 0.0);
            glRotatef(15, 0, 0, 1);
            //if (heading < -225.0f)
            //{
            //    glRotatef(-45.0f,0,1,0);
            //}
            //else if (heading < -179.0f)
            //{
            //    glRotatef(heading + 180.0f,0,1,0);
            //}
            //else if (heading < -45.0f)
            //{
            //    glRotatef(-45.0f,0,1,0);
            //}
            //else
            //{
            //    glRotatef(heading,0,1,0);
            //}

            glPushMatrix();	
                drawTire(11);
            glPopMatrix();
            drawFrontFrame();
            glTranslatef(-0.01, 1.2, 0.0);
            glPushMatrix();
                drawHead();					
            glPopMatrix();
        glPopMatrix();	
    

        glPushMatrix();
            glTranslatef(1.0f, 1.6f, 0.0f);
            glRotatef(45, 0.0f, 1.0f, 0.0f);
            if (okToDrawSpear)
                drawSpear(0.4, 0, 5.00, 75, 75);
        glPopMatrix();
    glPopMatrix();
    glDisable(GL_COLOR_MATERIAL);
    
}