From: Marcin Romaszewicz (marcin++at++asmodean.engr.sgi.com)
Date: 11/27/2001 14:11:52
A frustum corresponds to the OpenGL projection matrix. You definitely DO
NOT want your eye position and orientation encoded in the projection
matrix, it leads to a lot of problems. The proper way to do this is to set
up a frustum once with your desired field of view, then use
pfChannel::setView to set the position of the eye
point. pfChannel::setView applies the eye transformation to the modelview
matrix stack, which is the right way to do it.
-- Marcin
On Tue, 27 Nov 2001, Skluzacek, Christian wrote:
> I'm trying to set the position and orientation of a pfFrustum and I'm
> getting some weird behavior. I'm using Vega on Irix so I'm mixing the math
> functions of the two libraries (which may not be valid AFAIK). For example:
>
> // ----------------------------------
> // Update the position of the frustum
> // ----------------------------------
> vgMat vgmat;
> vgGetPosMat( position(), vgmat );
> // Convert to pfMatrix. Both vgMatrix and pfMatrix are float[4][4]
> // so hope they are in the same row-column order?????
> pfMatrix pfmat;
> memcpy( pfmat.mat, vgmat, sizeof(pfmat.mat) );
> m_pFrustum->orthoXform( m_pFrustum, pfmat );
> m_pFrustum->apply();
>
> for vgPosition set as: 50,0,0,0,0,0
> pfFrustum: 0x6410e430, frustType 0
> eye point (3050.000000 0.000000 0.000000)
> near clip plane 1.000000, far clip plane 1000.000000
> FOV fovh 45.000000, fovv 45.000000
> AspectRatio 1.000000
> corners[0] (3049.585938 1.000000 -0.414214)
> corners[1] (3050.414062 1.000000 -0.414214)
> corners[2] (3050.414062 1.000000 0.414214)
> corners[3] (3049.585938 1.000000 0.414214)
> corners[4] (2635.786377 1000.000000 -414.213562)
> corners[5] (3464.213623 1000.000000 -414.213562)
> corners[6] (3464.213623 1000.000000 414.213562)
> corners[7] (2635.786377 1000.000000 414.213562)
>
> For a vgPosition of: 0,50,0,0,0,0
> pfFrustum: 0x6410e430, frustType 0
> eye point (0.000000 2250.000000 0.000000)
>
> For a vgPosition of: 0,0,0,1.57,0,0
> pfFrustum: 0x6410e430, frustType 0
> eye point (0.000000 0.000000 0.000000)
> near clip plane 1.000000, far clip plane 1000.000000
> FOV fovh 45.000000, fovv 45.000000
> AspectRatio 1.000000
> corners[0] (-0.441456 0.988276 -0.414214)
> corners[1] (0.386660 1.010973 -0.414214)
> corners[2] (0.386660 1.010973 0.414214)
> corners[3] (-0.441456 0.988276 0.414214)
> corners[4] (-441.456329 988.275940 -414.213562)
> corners[5] (386.659821 1010.973328 -414.213562)
> corners[6] (386.659821 1010.973328 414.213562)
> corners[7] (-441.456329 988.275940 414.213562)
>
> and then the program crashes....
>
> What is the correct way of setting the position and orientation of a
> pfFrustim??
>
> Thanks,
> Chris
>
>
>
>
> ****************************************************************************
>
> This communication is intended for use by the addressee and may
> contain confidential or privileged information. If you receive this
> communication unintentionally, please notify us immediately and
> delete the message from your computer without making any copies.
>
> ****************************************************************************
>
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
>
This archive was generated by hypermail 2b29 : Tue Nov 27 2001 - 14:11:55 PST