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 3 of 3

Thread: gluPerspective after glOrtho

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2004
    Posts
    1

    gluPerspective after glOrtho

    Hei Everybody!
    I just started to study OpenGL and have some problems with perspective projection.
    I have a program in which a cube bouncing on the screen. If I create my 3D space like

    glOrtho(-range,range,-range,range,-range,range)

    it works without any troubles. But if I change to

    gluPerspective(angle,aspect,1.0,2*range)
    or
    glFustrum(-range,range,-range,range,-range,range)

    Either I can't see anything in my window or I can notice that my viewing-point is somewhere 'in the created space' and the cube can go 'behind me'.
    How could I manage to see the same space just like with glOrtho?
    Is it necessary to use gluLookAt(...) with glPerspective? What is the default viewing-point after creating a space with gluPerspective? Is there a process to calculate gluPerspective() from glOrtho?

    Thx: tmgergo

  2. #2
    Junior Member Regular Contributor
    Join Date
    Aug 2004
    Location
    Angers, France
    Posts
    248

    Re: gluPerspective after glOrtho

    [HS]Is it glFrustum(), glFrustrum() or glFustrum() ???[/HS]
    The .Product will make you .Believe

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: gluPerspective after glOrtho

    Hi !

    If you don't transform the "camera" it is located at 0,0,0 so you would maybe need to at least do a translate(0,0,z) to make your stuff visible.

    The faq on this website has lots of helpful information on this, have a look in the transformation section.

    Mikael

Posting Permissions

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