Results 1 to 3 of 3

Thread: Cube within a Cube

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    halifax,NS, canada
    Posts
    15

    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

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Cube within a Cube

    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

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2002
    Location
    Florence, Ky USA
    Posts
    27

    Re: Cube within a Cube

    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

Similar Threads

  1. Cube Map without using OpenGL's Cube Mapping
    By someoney in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-10-2010, 01:05 PM
  2. display a cube inside another bigger cube
    By jyoung77 in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-08-2003, 06:12 PM
  3. Wire Cube, and Cube and GUI
    By tony_ee81 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 09-20-2002, 12:58 PM
  4. Cube,Cube and a Cylinder
    By tony_ee81 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-03-2002, 12:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean