Re: Viewing Matrix

New Message Reply Date view Thread view Subject view Author view

Dave Cooper (davec++at++cory.coryphaeus.com)
Thu, 22 Dec 1994 17:31:44 -0800 (PST)


>
> Hello,
> I am tring to calculate clip coordinates for objects in my
> frustrum by creating a transformation matrix (Projection matrix
> * Viewing matrix) and passing the object vector (xpos,ypos,zpos,1)
> through the transformation matrix then dividing the resultant
> vector with the homogeneous value. My problem is getting the
> viewing matrix. I am unable to use the MMODE VIEWING for, it
> gives me the model matrix + the view matrix. Any suggestions?
>
If you have a copy of pfdwb.c (version 2.32 or above) there are the functions

                clipRegionOn
                clipRegionOff
                map_viewport
                wtoscrn

that do the following:

        Take a lower left corner and upper right world values
        convert those to screen space and then
        uses callbacks to clip that object when its drawn.

There may be something in that code that you can reuse. If you dont have
a recent release let me know and I'll send you a copy. Or if your models are
in dwb format then you can just mark the group as a clip region and leave the
rest up to the loader.

DaveC


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:50:45 PDT

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