rotating space ship

Started by
29 comments, last by unbird 10 years, 1 month ago


What happens if you only rotate, and remove the translate?
What happens if you only translate?

ok I will try that

Advertisement

here is my code

void DrawShip(GLfloat position_X,GLfloat position_Y, GLfloat position_Z, GLfloat rotation,GLfloat color)
{
glPushMatrix();
glColor3f(color,0.0f,0.0f);
glRotatef(rotation,0.0f,0.0f,1.0f);
glTranslatef(position_X,position_Y,position_Z);
glBegin(GL_LINE_LOOP);
glVertex3f(0.0f,-0.25f,0.0f);
glVertex3f(-0.25f,-0.5f,0.0f);
glVertex3f(-0.5f,-0.5f,0.0f);
glVertex3f(-0.0f,0.5f,0.0f);
glVertex3f(0.5f,-0.5f,0.0f);
glVertex3f(0.25f,-0.5f,0.0f);
glVertex3f(0.0f,-0.25f,0.0f);
glEnd();
glPopMatrix();
}

I tried rotate only and it only rotates and I tried translate only and it only moves.


I tried rotate only and it only rotates
But does it rotates correctly? Or around some weird point?

it rotates around the screen origin

I'm pretty sure you are beyond help you've been asking this same question for years. Have you tried learning some maths?

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

I'm pretty sure you are beyond help you've been asking this same question for years. Have you tried learning some maths?

http://www.arcsynthesis.org/gltut/

This might be of help.

Hello to all my stalkers.

what math should I study

Vectors and linear algebra.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

what part of linear algebra should I focus on?

This topic is closed to new replies.

Advertisement