PDA

View Full Version : Cube within a Cube



tony_ee81
08-15-2002, 12:05 PM
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

nexusone
08-15-2002, 01:09 PM
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

Kent767
08-18-2002, 02:17 AM
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