Re: Moving Viewpoints

New Message Reply Date view Thread view Subject view Author view

Randy Stiles (stiles++at++aic.lockheed.com)
Wed, 09 Oct 1996 10:28:53 -0700


Gamble, Murray - Kan AV wrote:
>
> Hi,
>
> Our local SGI sales representative, Jim Merson, referred me to this address.
> I was hoping that someone might be able to answer a question I have
> regarding viewpoints(i.e. ChanView) in Performer. Obviously, a viewpoint
> can be moved or animated via x,y,z and h,p,r inputs to ChanView - but is
> there an easy was to attach a viewpoint to a DCS? Specifically, I am
> creating a visual simulation that involves animating the flight deck motion
> on a ship - I have created a new DCS for the ship and have attached a model
> to it. We now need to place the viewpoint as if we were an individual
> standing at different points on the flight deck as it is pitching, rolling
> and heaving. Essentially, I'd like to be able to attach the viewpoint to
> the ship's DCS but have been unable to find any reference to such an
> operation in the literature. How can this be done? I assume there has to
> be provisions for this, as I believe this type of scenario is quite
> frequent. So far I've been playing trigonometry games and have only met
> with limited success.

You need to calculate the world matrix, from the root pfScene down
to the ship's dcs. Then multiply the desired point of the observer on the
ship against this world matrix.

It should be possible for you to make a subclass of pfDCS that updates the
view. Call it viewDCS. You make an instance of this class the child
of your ship dcs. Then you move the viewer relative to the ship by
setting this viewDCS's translation and orientation relative only to the ship.
The update is done by traversing the scene graph from the viewDCS up
to the pfSCene, post multiplying matrices to get a world matrix. Then
the translation and orientatin of this world matrix is used to
update the pfChanMat.

In your viewDCS class, you would handle semantics of which viewDCS owns
the viewer at any time, so that but one has ownership. We have done
something similar, so I know this approach works.

-Randy

-- 
// Randy Stiles mailto:stiles++at++aic.lockheed.com Orgn H142 Bldg 255
// Lockheed Martin Advanced Technology Center  3251 Hanover Street 
// office: 415.354.5256  fax: 415.354.5235     Palo Alto, CA 94304-1192
// http://vet.parl.com/~vet/people/stiles/
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

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

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