Re: Moving objects

New Message Reply Date view Thread view Subject view Author view

Andy Shein (ashein++at++orac.boston.sgi.com)
Tue, 28 Jul 1998 11:21:10 -0700


On Jul 28, 6:48pm, Andrew Bailey wrote:
> Subject: Moving objects
> Hello to all,
>
> I have written a Performer application which will eventually evolve into
> a driving simulator, and I am currently wondering how to get some
> objects around the scene by themselves. I am using Performer2.2
> (although modelling is done in MultiGen1.4). I have a static car in the
> scene at the moment. The road has a line defined along the centre and I
> want the car to move along that line at a set speed. I have added the
> car in MultiGen, so at the moment it is lurking somewhere in the
> Performer scene graph. I have only been using Performer for a couple of
> months now but I am pretty confident with it (I think!).
>
> Anyway, I am searching the scene graph for the pfGeoSet which has the
> polyline in and I have managed to access the co-ordinates of the line
> (there are only 2 as it's a straight section of road). I have also
> calculated the correct XYZ position I want to move the car to (depending
> on the set speed) along the road. Now for my question.
>
> How do I update the co-ordinates of my "car" which is just sitting on
> the road at the moment?
> Should I not include the car in the MultiGen database, and instead add
> the object at runtime (the car is a stand alone .flt file I simply
> instanced in MultiGen)? I think this can be done.
> Or should I be searching for the car in the Performer scene graph and
> updating its transformation with my new co-ordinates? I think I will be
> needing some sort of DCS for the car anyway.

    You could do it several ways, but in the end
you want the car under a DCS in the scene. You could load
it in seperatly and add it to a DCS attached to the scene.
Use the flt loader callback to get at the car, or just use pfNode::find()
if you have created a mgDOF node in the flt file above the car.
Then just use pfDCS::setTrans or pfDCS::setCoord to
position the car. The README file for the flt loader will
tell you more.
                        Andy

>
> Hope someone can understand all that!
> thanks,
> Andrew Bailey
>
>
>
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Andrew Bailey

-- 
Andrew Shein   SE Stout               email: ashein++at++boston.sgi.com
Silicon Graphics Inc.                 phone: (978) 562 - 4800
1 Cabot Road                            fax: (978) 562 - 4755
Hudson, MA 01749                      vmail: 59688
=======================================================================
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:57:45 PDT

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