Original Post
Alright... I have just started learning opengl a week ago and am in a problem...i wrote a code to rotate a 3d cube on the vector (1.0f,1.0f,1.0f)...The cube does rotate on the axis but,well,it does not look like a cube..it looks something else.. Here are the coordinates which i plotted... glBegin(GL_QUADS); glColor3f(1.0f,1.0f,0.0f); glVertex3f(0.25f,0.25f,-0.25f); glVertex3f(-0.25f,0.25f,-0.25f); glVertex3f(-0.25f,0.25f,0.25f); //top glVertex3f(0.25f,0.25f,0.25f); glColor3f(0.0f,1.0f,0.0f); glVertex3f(-0.25f,0.25f,0.25f); glVertex3f(-0.25f,0.25f,-0.25f); glVertex3f(-0.25f,-0.25f,-0.25f); glVertex3f(-0.25f,-0.25f,0.25f); //left glColor3f(1.0f,0.0f,0.0f); glVertex3f(0.25f,-0.25f,-0.25f); glVertex3f(-0.25f,-0.25f,-0.25f); glVertex3f(-0.25f,0.25f,-0.25f); //back glVertex3f(0.25f,0.25f,-0.25f); glColor3f(0.0f,0.0f,1.0f); glVertex3f(-0.25f,-0.25f,0.25f); glVertex3f(-0.25f,-0.25f,-0.25f); glVertex3f(0.25f,-0.25f,-0.25f); //bottom glVertex3f(0.25f,-0.25f,0.25f); glColor3f(1.0f,0.0f,1.0f); glVertex3f(-0.25f,0.25f,0.25f); glVertex3f(-0.25f,-0.25f,0.25f); glVertex3f(0.25f,-0.25f,0.25f); glVertex3f(0.25f,0.25f,0.25f); //front glColor3f(0.0f,1.0f,1.0f); glVertex3f(0.25f,0.25f,-0.25f); glVertex3f(0.25f,0.25f,0.25f); glVertex3f(0.25f,-0.25f,0.25f); glVertex3f(0.25f,-0.25f,-0.25f); //right during the rotation when the bottom,front and right faces come towards the front only then it resembles a cube i.e. only den you can see three colors/face or else for all other positions there are more then 3 colors which makes the window a mess... please help..!!!





