Results 1 to 2 of 2

Thread: glFrustum Frustrations

  1. #1
    Member Contributor
    Join Date
    Feb 2000

    glFrustum Frustrations

    Or should I say ďglFrustum-rations?Ē

    Here is my problem (this is going to take a bit to describe, so bear with me):

    I have a pair of CrystalEyes shutter glasses and a Logitech ultrasonic head tracking system. I am trying to use this equipment to display a 3D, world-stabilized scene; that is, as the userís head position changes, the displayed objects appear to be stationary with respect to the real world. This turns out to be kind of an interesting problem because the userís physical position is in effect supplying some of the viewing transformation for you scene (just thinking out loud there, ignore it if it sounds odd). To picture the desired effect, think of the monitor as a window into a virtual world located behind the glass.

    To get the effect that Iím after I eventually decided that I need to use glFrustum to define an asymmetric viewing volume with respect to the viewer. I thought I pretty much had it by doing something like this:
    // Left eye
    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    NOSE_POSITION[2], NOSE_POSITION[2] + BOX_DEPTH*2); // front, back (*2 just for good measure)

    glMatrixMode (GL_MODELVIEW);
    But as I move the head position around the scene I get some odd distortion in the objects (my spheres become ellipsoids).

    Iím going to give up on trying to describe this verbally and instead post some very simple test code and executable. You can download them from:

    The program displays a wireframe box that is the same dimensions as the screen and two spheres in the center, directly aligned with each other along the z-axis. Use the number pad to change the head position: 4:Ėx, 6:+x, 8:+y, 2:-y, 9:-z, 1:+z. For clarity, the right eye image is drawn in red, and the left eye in blue (of course for the actual app, Iíd be using left and right stereo buffers).

    In the real world a spherical object never appears elliptical, so the distortion seen as you move around is definitely wrong.

    Thanks for your time. Any insight into my problem is greatly appreciated.


    [This message has been edited by Rob (edited 04-23-2000).]

    [This message has been edited by Rob (edited 04-23-2000).]

  2. #2
    Member Contributor
    Join Date
    Feb 2000

    Re: glFrustum Frustrations

    I'm rather shocked, but the above problem is not actually a problem.

    I came into work and ran the above sample using the shutter glasses and the distortion turns out to be correct. When you move to the correct position with the glasses on, the ellipsoids "squash" back into spheres. I suppose what's going on here is that the 2D projections of the spheres onto the screen are indeed ellipsoids and when my brain gets the right stereoscopic cues it sorts things out properly.

    A really spooky effect with the glasses on, I have to say.

    Thanks anyway.


    [This message has been edited by Rob (edited 04-23-2000).]

Similar Threads

  1. Lighting Frustrations
    By Vamirr in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-13-2011, 06:00 PM
  2. glFrustum
    By Mukund in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-10-2010, 08:33 AM
  3. glFrustum Frustrations
    By Seedload in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-23-2010, 02:41 PM
  4. 3D Modeling Software Frustrations!!!
    By pleopard in forum OpenGL: Advanced Coding
    Replies: 22
    Last Post: 08-18-2003, 05:35 PM
  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