Barry S. Folse (bfolse++at++ix.netcom.com)
Mon, 27 Apr 1998 17:21:15 -0500
I'm not sure how that would be done, possibly by giving the view matrix a negative Y-scale. Anyone?
Barry Folse
-----Original Message-----
From: Sylvain Mayer
Sent: Tuesday, April 14, 1998 1:42 PM
To: info-performer++at++sgi.com
Subject: Re: rear-view mirror
Alain Chauffaut wrote:
>
> Hello,
>
> I would like to simulate a rear-view mirror with Performer.
>
Hi,
all you need to do is create a new channel with different parameters
from your main channel (the rear channel can be attached to your main
channel and they will share attributes like scene and so on). They have
to have different viewport and of course you want to have an offset to
look behind.
This should be something like your starting point:
// create both channels
chans[MAIN_CHANNEL] = new pfChannel(pipe);
chans[REAR_CHANNEL] = new pfChannel(pipe);
chans[MAIN_CHANNEL]->attach(chans[REAR_CHANNEL]);
// you don't want to share the view
uint share = chans[MAIN_CHANNEL]->getShare();
share &= ~PFCHAN_VIEW;
chans[MAIN_CHANNEL]->setShare(share);
// attach the scene only to the first channel
chans[MAIN_CHANNEL]->setScene(scene);
// rear channel will look behind and be drawn in the upper right corner
offset.xyz.set(0.0f, 0.0f, 0.0f);
offset.hpr.set(180.0f, 0.0f, 0.0f);
chans[REAR_CHANNEL]->setViewOffsets(offset.xyz, offset.hpr);
chans[REAR_CHANNEL]->setViewport(0.65f, 1.0f, 0.65f, 1.0f);
--Sylvain Mayer, 3D Graphics Developer Visual Database Tools CAE Electronics Ltd. (http://www.cae.ca) ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
===================================List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:18 PDT