Non-orthogonal Perspective Matrices

New Message Reply Date view Thread view Subject view Author view

lechnerr++at++adadv1.mdc.com
Mon, 8 May 1995 16:23:53 -0500


I am developing an application that requires the screen projection plane to be non-normal to the
eye line of sight vector. The screen plane can move in both azimuth and elevation. This, of
course induces keystone in the image without compensation. I would like to correct for this in
the perspective transformation in Performer. Does anybody have the proper matrix transformation
to multiply the perspective matrix by to induce keystone distortion correction on the projection
plane.

                                    . |
                                . | Screen
                            . | Plane
                        . .|
                    . .
                . .
         eye < .

I also want to make sure I am attaching the perspective matrix correctly. The following is a
snipet from my code. It is within a Draw Callback function.

(done before DrawCallback)
frust1 = pfNewFrustum(NULL);
frust2 = pfNewFrustum(NULL);

Draw Callback:
{

/** Set up Key Comensation Matrix **/
pfMakeIdentMat(key_comp_mat);
pfSetVec3(key_comp_vec,key_x,key_y,key_z);
pfSetMatColVec3(key_comp_mat,2,key_comp_vec);

/** Get Perspective Frustum and Apply Comp **/
pfGetBaseFrust(chan,frust1);
pfOrthoXformFrust(frust2,frust1,key_comp_mat);
pfApplyFrust(frust2);

pfDraw();

}

This seems to effect the perspective correctly. I'm just missing the correct compensation
factors.

PS- I tried putting the frustum data back into pfChan in pfOrthoXformFrust as the man pages
state, but it complained. My only guess is that pfChan does not carry along the actual
projection matrix, on the perspective parameters to build the matrix?

RJL
McDonnell Douglas Corp.


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:29 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.