Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Transformation and glOrtho

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2003
    Posts
    10

    Transformation and glOrtho

    hi all,

    assume a program that just displays a cube.
    Now, when i convert the code ;
    gluPerspective(fov, a_ratio, znear, zfar);
    to;
    glOrtho(-1.0f,1.0f,-1.0f,1.0f,znear,zfar);

    i cant make the cube get smaller as it goes far from me.(z axis)

    i mean whatever you make the -3.0 in glTranslatef, the cube stays there!

    i would like to ask the reason and how to.

    Code is below;

    void COpenGLDlg: isplayGL()
    {
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    glClearColor(0.0,0.0,0.0,0.0);
    glPushMatrix();
    glTranslatef(-0.2,-0.2,-3.0);
    glColor3f(1.0,0.0,0.0);
    glutSolidCube(1);
    glPopMatrix();
    SwapBuffers(map_window_dc);
    }

    Thanks For Your Kind Interests.

    Burak

  2. #2
    Intern Contributor
    Join Date
    Feb 2002
    Location
    Italia
    Posts
    63

    Re: Transformation and glOrtho

    glOrtho = Orthographic projection
    gluPerspective = Perspective projection

    glOrtho ALWAYS generates a flat 2D Isomethric view.


Posting Permissions

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