Gene Koh (gene++at++euphoria.corp.sgi.com)
Thu, 1 Aug 1996 13:54:13 -0700
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.4230simplicity 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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:18 PDT