Skip to main content
deleted 36 characters in body
Source Link

Turns out this was an issue with my perspective, I was able to solve my problem by setting the gluPerspective correctly:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    // remainder code is the same as before...
}

Thanks for everyone's help!

Turns out this was an issue with my perspective, I was able to solve my problem by setting the gluPerspective correctly:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    // remainder code is the same as before...
}

Thanks for everyone's help!

Turns out this was an issue with my perspective, I was able to solve my problem by setting the gluPerspective correctly:

void C_MediaLoader::display(void)
{
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    // remainder code is the same as before...
}

Thanks for everyone's help!

deleted 1416 characters in body
Source Link
House
  • 73.5k
  • 17
  • 188
  • 276

OK, Sooo...

I guess my best advice for anyone that runs intoTurns out this situation, and is really tired, just remember that changing the glMatrixMode, will usually help...

I feel really stupid, and I feel really bad for wasting people's time on something dumb.

I wish I had better thinking skills at night.

here iswas an image ofissue with my gratitude! enter image description here

it's a random model!

btwperspective, here is the code I changedwas able to solve my problem by setting the gluPerspective correctly:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    float tmp;

    glTranslatef(0,0,-8);
    // rotate it around it's axes
    glRotatef(angle,1.f,1.f,1.f);
    glColor4f(1,1,1,1);

    // scale the whole asset to fit into our view frustum 
    tmp = scene_max.x-scene_min.x;
    tmp = aisgl_max(scene_max.y - scene_min.y,tmp);
    tmp = aisgl_max(scene_max.z - scene_min.z,tmp);
    tmp = (1.0f / tmp);
    glScalef(tmp*4, tmp*4, tmp*4);

       remainder //code centeris the model
   same glTranslatef(as -scene_centerbefore.x, -scene_center.y, -scene_center.z );
        // if the display list has not been made yet, create a new one and
        // fill it with scene contents
    if(scene_list == 0) {
        scene_list = glGenLists(1);
        glNewList(scene_list, GL_COMPILE);
            // now begin at the root node of the imported data and traverse
            // the scenegraph by multiplying subsequent local transforms
            // together on GL's matrix stack.
        recursive_render(scene, scene->mRootNode);
        glEndList();
    }

    glCallList(scene_list);

    do_motion();
}

Thanks for everyone's help!

OK, Sooo...

I guess my best advice for anyone that runs into this situation, and is really tired, just remember that changing the glMatrixMode, will usually help...

I feel really stupid, and I feel really bad for wasting people's time on something dumb.

I wish I had better thinking skills at night.

here is an image of my gratitude! enter image description here

it's a random model!

btw, here is the code I changed:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    float tmp;

    glTranslatef(0,0,-8);
    // rotate it around it's axes
    glRotatef(angle,1.f,1.f,1.f);
    glColor4f(1,1,1,1);

    // scale the whole asset to fit into our view frustum 
    tmp = scene_max.x-scene_min.x;
    tmp = aisgl_max(scene_max.y - scene_min.y,tmp);
    tmp = aisgl_max(scene_max.z - scene_min.z,tmp);
    tmp = (1.0f / tmp);
    glScalef(tmp*4, tmp*4, tmp*4);

        // center the model
    glTranslatef( -scene_center.x, -scene_center.y, -scene_center.z );
        // if the display list has not been made yet, create a new one and
        // fill it with scene contents
    if(scene_list == 0) {
        scene_list = glGenLists(1);
        glNewList(scene_list, GL_COMPILE);
            // now begin at the root node of the imported data and traverse
            // the scenegraph by multiplying subsequent local transforms
            // together on GL's matrix stack.
        recursive_render(scene, scene->mRootNode);
        glEndList();
    }

    glCallList(scene_list);

    do_motion();
}

Turns out this was an issue with my perspective, I was able to solve my problem by setting the gluPerspective correctly:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    // remainder code is the same as before...
}

Thanks for everyone's help!

added 1364 characters in body
Source Link

OK, Sooo...

I guess my best advice for anyone that runs into this situation, and is really tired, just remember that changing the glMatrixMode, will usually help...

I feel really stupid, and I feel really bad for wasting people's time on something dumb.

I wish I had better thinking skills at night.

here is an image of my gratitude! enter image description here

it's a random model!

btw, here is the code I changed:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    float tmp;

    glTranslatef(0,0,-8);
    // rotate it around it's axes
    glRotatef(angle,1.f,1.f,1.f);
    glColor4f(1,1,1,1);

    // scale the whole asset to fit into our view frustum 
    tmp = scene_max.x-scene_min.x;
    tmp = aisgl_max(scene_max.y - scene_min.y,tmp);
    tmp = aisgl_max(scene_max.z - scene_min.z,tmp);
    tmp = (1.0f / tmp);
    glScalef(tmp*4, tmp*4, tmp*4);

        // center the model
    glTranslatef( -scene_center.x, -scene_center.y, -scene_center.z );
        // if the display list has not been made yet, create a new one and
        // fill it with scene contents
    if(scene_list == 0) {
        scene_list = glGenLists(1);
        glNewList(scene_list, GL_COMPILE);
            // now begin at the root node of the imported data and traverse
            // the scenegraph by multiplying subsequent local transforms
            // together on GL's matrix stack.
        recursive_render(scene, scene->mRootNode);
        glEndList();
    }

    glCallList(scene_list);

    do_motion();
}

OK, Sooo...

I guess my best advice for anyone that runs into this situation, and is really tired, just remember that changing the glMatrixMode, will usually help...

I feel really stupid, and I feel really bad for wasting people's time on something dumb.

I wish I had better thinking skills at night.

here is an image of my gratitude! enter image description here

it's a random model!

OK, Sooo...

I guess my best advice for anyone that runs into this situation, and is really tired, just remember that changing the glMatrixMode, will usually help...

I feel really stupid, and I feel really bad for wasting people's time on something dumb.

I wish I had better thinking skills at night.

here is an image of my gratitude! enter image description here

it's a random model!

btw, here is the code I changed:

void C_MediaLoader::display(void)
{
    glMatrixMode(GL_MATRIX_MODE);
    glLoadIdentity();
    gluPerspective(45, 640/480,
        1.0, 1000.0);  /* Znear and Zfar */

    float tmp;

    glTranslatef(0,0,-8);
    // rotate it around it's axes
    glRotatef(angle,1.f,1.f,1.f);
    glColor4f(1,1,1,1);

    // scale the whole asset to fit into our view frustum 
    tmp = scene_max.x-scene_min.x;
    tmp = aisgl_max(scene_max.y - scene_min.y,tmp);
    tmp = aisgl_max(scene_max.z - scene_min.z,tmp);
    tmp = (1.0f / tmp);
    glScalef(tmp*4, tmp*4, tmp*4);

        // center the model
    glTranslatef( -scene_center.x, -scene_center.y, -scene_center.z );
        // if the display list has not been made yet, create a new one and
        // fill it with scene contents
    if(scene_list == 0) {
        scene_list = glGenLists(1);
        glNewList(scene_list, GL_COMPILE);
            // now begin at the root node of the imported data and traverse
            // the scenegraph by multiplying subsequent local transforms
            // together on GL's matrix stack.
        recursive_render(scene, scene->mRootNode);
        glEndList();
    }

    glCallList(scene_list);

    do_motion();
}
Source Link
Loading