Re: DCS and matrix help needed please.

New Message Reply Date view Thread view Subject view Author view

Gene Koh (gene++at++euphoria.corp.sgi.com)
Thu, 1 Aug 1996 13:54:13 -0700


On Aug 1, 1:03pm, Daniel Delgado wrote:
>
> Now I have a point that is in the original Performer Coordinate system
(vehicle[1].xyz)
> and I want to find out what its value is in the rotated and translated DCS
system.
>
> I think I know just enough to screw up! In other words, the approach below is
> Wrong wrong wrong....
>
> pfGetDCSMat(vehicle[0].dcs,Matrix1);
> pfXformPt3(IntrusionVect, vehicle[1].xyz, Matrix1);
>
> xnew = IntrusionVect[PF_X] + (vehicle[1].xyz[PF_X] -
vehicle[0].xyz[PF_X]);
> ynew = IntrusionVect[PF_Y] + (vehicle[1].xyz[PF_Y] -
vehicle[0].xyz[PF_Y]);
> znew = IntrusionVect[PF_Z] + (vehicle[1].xyz[PF_Z] -
vehicle[0].xyz[PF_Z]);
>
> xnew and ynew and znew are way off!

OK, so it sounds like you want to know where vehicle[1]'s position (in world
coordinates) lies relative to vehicle[0]'s local coordinate system.

First, figure out where the origin of vehicle[0]'s coordinate system is in
world coordinates:
         pfGetDCSMat(vehicle[0].dcs, Matrix1);
        pfSetVec3(origin, 0, 0, 0);
        pfXformPt3(originInWorld, origin, Matrix1);

Then, calculate the difference between vehicle[1]'s position and the position
of vehicle[0]'s local origin:

        xnew = vehicle[1].xyz[PF_X] - originInWorld[PF_X];
        ynew = vehicle[1].xyz[PF_Y] - originInWorld[PF_Y];
        znew = vehicle[1].xyz[PF_Z] - originInWorld[PF_Z];

Hopefully that'll yield something close to correct!

-- 
gene koh		gene++at++corp.sgi.com		415.933.4230

simplicity patience compassion ======================================================================= 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:18 PDT

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