Results 1 to 3 of 3

Thread: glFrustum

  1. #1
    Guest

    glFrustum

    Hi all,

    as far as I know glFrustum() is changing the perspective of viewing the scene.

    I've tried to do something with the command, but, no matter what values I add, it won't change anything on the perspective. When do I have to state it exactly, to get a result?

    My looks like the following:

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum (-1.0, 1.0, -1.0, 1.0, 3.0, -3.0);
    glTranslatef(0.0f, 0.0f, 1.0f);

    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity();
    glPushMatrix();
    [...]
    glBegin (GL_QUADS);
    glArrayElement(0);
    glArrayElement(1);
    glArrayElement(2);
    glArrayElement(3);
    glEnd();
    [...]
    glPopMatrix();

    Any answer, would help.

    Thanks,

    Daniel

  2. #2
    Guest

    Re: glFrustum

    Try something like this
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glTranslatef(0.0f, 0.0f, 1.0f);
    glFrustum (-1.0, 1.0, -1.0, 1.0, 3.0, -3.0);

    Otherwise you won't translate neiter the frustum view or the objects.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: glFrustum

    First, you shouldn't transform the projection matrix unless you know what will happen and this is what you want. It can/will mess up a few things in OpenGL (like fog, lighting, environment mapping, and maybe some more things).

    Second, when using glFrustum, near clipping plane must be less than the far clipping plane, and the near plane must be greater than zero. Using negative numbers or zero on either near of far plane, will generate an error code.

Similar Threads

  1. glFrustum
    By Mukund in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-10-2010, 08:33 AM
  2. help about glFrustum
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-16-2005, 10:32 PM
  3. glFrustum
    By Vlasko in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-28-2003, 09:11 AM
  4. glFrustum
    By imported_Flavius in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-18-2001, 03:55 AM
  5. glFrustum()...
    By jtwoods in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-20-2000, 01:08 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