×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    26

    OpenGL one object inside the other

    Hi,

    i am facing problem with object rendering on the screen in OpenGL.
    I am having a ring object which i draw on the screen. I am using same object
    (scaled) to put it inside first one. The problem is that second object is put over the first and not inside it:

    glPushMatrix();
    glRotatex( aFrame << 16, 1 << 16 , 0 , 0 );
    DrawBox( 1.7f, 1.7f, 1.7f );
    glPopMatrix();
    glPushMatrix();
    glRotatex( (-aFrame-10) << 16, 0 , 1 << 16 , 0 );
    DrawBox( 1.f, 1.f, 1.f );
    glPopMatrix();

    ...


    DrawBox( GLfloat aSizeX, GLfloat aSizeY, GLfloat aSizeZ ) {
    glScalef( aSizeX, aSizeY, aSizeZ );
    glDrawElements( GL_TRIANGLES, 512 * 3, GL_UNSIGNED_BYTE, triangles);
    }

    How can i place one object inside the other?
    Thanks.

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    26

    Re: OpenGL one object inside the other

    Ok, i found soluton.

    in the init part i have to put:
    glEnable( GL_DEPTH_TEST );
    glDepthFunc(GL_LEQUAL);

    also i had to add
    "EGL_DEPTH_SIZE,16"
    in properties for the wanted EGLSurface.
    It seems that initial EGL_DEPTH_SIZE is 0 so no correct overlapping occur.

Similar Threads

  1. active object call inside another active object
    By maina1976 in forum Symbian C++
    Replies: 4
    Last Post: 2008-08-25, 13:05
  2. Replies: 2
    Last Post: 2007-10-05, 20:40
  3. Start a thread inside Active object?
    By tanechka_a in forum Symbian C++
    Replies: 0
    Last Post: 2005-12-13, 17:01
  4. Replies: 2
    Last Post: 2003-09-01, 22:15
  5. Replies: 1
    Last Post: 2002-08-28, 09:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •