I have problem moving the little cube which is inside big cube.
void myCube(void) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glRotatef(angle, 0.0, 1.0, 0.0);
glBegin(GL_LINE_LOOP);
//draw
glEnd();
glBegin(GL_LINE_LOOP);
//draw
glEnd();
glBegin(GL_LINE_LOOP);
//draw
glEnd();
glBegin(GL_LINE_LOOP);
//draw
glEnd();
glPushMatrix();
glLoadIdentity();
glTranslated(15, 1, 0);
createLittleCube(50);
glPopMatrix();
glutSwapBuffers();
glFlush();
}
int main(int argc, char **argv){
glutInit(&argc, argv);
glutInitWindowSize(800, 700);
glutInitWindowPosition(200 , 70);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("move cube");
glutDisplayFunc(myCube);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glClearColor(0.0, 0.0, 0.0, 1.0);
menuInit();
glutMainLoop();
}
Can anyone give me suggestion on how to move little cube without big cube moving.
Thank you