Lew Hitchner (hitchner++at++netcom.com)
Tue, 23 Nov 1993 10:11:37 -0800
Lew Hitchner
Xtensory Inc.
Scotts Valley, CA
void ViewUpdate(
ObjectPtr viewObjPtr
)
{
ViewPtr theView;
int chan, nChannels;
ChannelPtr *chanInfoPtr;
pfMatrix channelViewTransf;
static pfMatrix
/* conversion transf. from:
RHS Euclidean Coords.:
+X = right, +Y = up, +Z = backwards
to SGI Performer Coords.:
+X = right, +Y = forwards, +Z = up
*/
coordTransfFwd =
{ { ONEF, ZEROF, ZEROF, ZEROF },
{ ZEROF, ZEROF, ONEF, ZEROF },
{ ZEROF, -ONEF, ZEROF, ZEROF },
{ ZEROF, ZEROF, ZEROF, ONEF } },
coordTransfInv =
{ { ONEF, ZEROF, ZEROF, ZEROF },
{ ZEROF, ZEROF, -ONEF, ZEROF },
{ ZEROF, ONEF, ZEROF, ZEROF },
{ ZEROF, ZEROF, ZEROF, ONEF } };
if (viewObjPtr == (ObjectPtr)NULL)
return;
theView = (ViewPtr)viewObjPtr;
.
.
.
/*
** Set the viewing transformation matrix for each channel.
*/
nChannels = theView->chanList->nChannels;
for (chan = 0, chanInfoPtr = theView->chanList->chanInfo;
chan < nChannels; chan++, chanInfoPtr++) {
/*
** Get the transformation matrix for the View platform
** associated with this 3D viewing channel.
** (This is calculated elsewhere. It is calculated
** by pre-multiplying of inverse transf. rather than
** post-mult. forward transf.)
*/
vpGetGlobalTransf(theView->chanList->platform[chan],
(char *)NULL,
channelViewTransf, False, False);
.
.
.
/*
** Set Performer's channel view transf. matrix.
** Change coord. system from GL to SGI Performer coords.:
** from RHS with +X right, +Y up, and +Z backwards
** to RHS system with +X right, +Y forwards, and +Z up.
*/
matMultiply(coordTransfInv, channelViewTransf,
channelViewTransf);
pfChanViewMat((*chanInfoPtr)->pfchannel, channelViewTransf);
.
.
.
}
.
.
.
return;
}
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:06 PDT