Cube within a Cube

Hi Guys,
i just want to buld a big cube and within this big cube i want another small cube, i tried to do it by using the GL_Quads command two times but it did’t work.
I also want to change the position of small cube with different values.
Any idea and help will be appreciated

Very easy to do…

example code:

glPushMatrix();
glTranslatef(…); location of big cube.
glRotatef(…); rotate cube if wanted.

//draw large cube here.

glPopMatrix();

glPushMatrix();
glTranslatef(…); location of small cube.
glRotatef(…); rotate cube if wanted.

//draw small cube here.

glPopMatrix();

Originally posted by tony_ee81:
Hi Guys,
i just want to buld a big cube and within this big cube i want another small cube, i tried to do it by using the GL_Quads command two times but it did’t work.
I also want to change the position of small cube with different values.
Any idea and help will be appreciated

i could have read the question wrong,but it sounds like you are just drawing 2 quads… (a cube is made of 6 quads) a quad is a square…

Kent