Rotating a scene but keeping part of it still

New Message Reply Date view Thread view Subject view Author view

From: Rob Body (rdb++at++hrwallingford.co.uk)
Date: 09/18/2001 07:38:35


Hi Performer friends,

I have a maritime Performer application where I have an image of a ship
displayed along with the sea and terrain. The ship image represents the
ship that I am 'steering'. I am modelling waves and can get the scene to
pitch, roll and heave correctly but the problem is that my ship image does
too. How do I seperate my ship image from the rest of the scene so that it
doesn't move as well ?

Here are some snippets of code that I have used

Within InitSceneGraph(pfScene *scene);

bowimage = pfdLoadFile("bowimage.flt");
bowdcs = pfNewDCS;
pfAddChild(bowdcs,bowimage);
pfAddChild(scene,bowdcs);

Within updateView(pfChannel *chan);

get viewx, viewy, viewhdg, viewheight, roll, pitch and heave values

pfSetVec3(hpr,viewhdg,pitch,roll);
pfSetVec3(xyz,viewx,viewy,viewheight-heave);

pfChanView(chan,xyz,hpr);

pfCopyVec3(c.xyz, xyz);
pfCopyVec3(c.hpr, hpr);
pfMakeCoordMat(mat, &c);
pfChanViewMat(chan, mat);
pfCopyMat(ViewState->viewMat, mat);

pfDCSTrans(bowdcs,viewx,viewy,0.0f);
pfDCSRot(bowdcs,hdg,0.0f,0.0f);

Can anyone see what I am doing wrong ?

If pitch, roll and heave are all 0 then it works fine but as soon as they
are not 0 they all move.

Thanks for your time.

Rob

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Rob Body
Simulator Manager

HR Mardyn
HR Wallingford
Howbery Park
Wallingford
Oxon
OX10 8BA

Tel 01491 822327
Fax 01491 832233

e-mail r.body++at++hrwallingford.co.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
HR Wallingford uses Faxes and Emails for confidential and
legally privileged business communications. They do not of
themselves create legal commitments. Disclosure to parties
other than addressees requires our specific consent. We are
not liable for unauthorised disclosures nor reliance upon
them. If you have received this message in error please
advise us immediately and destroy all copies of it.
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Sep 18 2001 - 07:42:48 PDT

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