Space wars clone

I got my ship to rotate about arbitrary axis. my next step is to get it to move up and down depending on which way it is facing. I got it to move up and down but not in the way it is facing after it is rotated here is my code so far.

void drawShip()
{
	glPushMatrix();
	glColor3f(1.0f, 0.0f, 0.0f);
	glTranslatef(50.0f, 0.0f+thrust, 0.0f);
	glRotatef(shipAngle, 0.0f, 0.0f, 1.0f);
	glBegin(GL_LINE_LOOP);
	glVertex3f(0.0f, 0.0f, 0.0f);
	glVertex3f(-5.0f, -5.0f, 0.0f);
	glVertex3f(0.0f, 10.0f, 0.0f);
	glVertex3f(5.0f, -5.0f, 0.0f);
	glEnd();
	glPopMatrix();
}
1 Like