[Solved] How to rotate a vector in opengl?

Yes OpenGL uses 4×4 uniform transform matrices internally. But the glRotate API uses 4 parameters instead of 3: glMatrixMode(GL_MODELVIEW); glRotatef(angle,x,y,z); it will rotate selected matrix around point (0,0,0) and axis [(0,0,0),(x,y,z)] by angle angle [deg]. If you need to rotate around specific point (x0,y0,z0) then you should also translate: glMatrixMode(GL_MODELVIEW); glTranslatef(+x0,+y0,+z0); glRotatef(angle,x,y,z); glTranslatef(-x0,-y0,-z0); This is … Read more