Edward Peters (elpeters++at++ncsa.uiuc.edu)
Tue, 31 Dec 1996 10:51:44 -0600
If you get your view right vector and normalize all your view vectors, you can
do something like this:
// build a matrix with three orthonormal vectors
pfMatrix myMat;
myMat.setRow(0,rightVec);
myMat.setRow(1,frontVec);
myMat.setRow(2,upVec);
pfCoord myCoord;
myMat.getOrthoCoord(&myCoord);
heading = myCoord.hpr[0];
pitch = myCoord.hpr[1];
roll = myCoord.hpr[2];
> 2: If I have a DCS object (sceneDCS) which is translated to a point
> x,y,z. How do I rotate the DCS about the origin?
>
> 2a: How do you rotate a DCS node about an arbitrary point.
Question 2 is just a specific case of question 2a. You should check out the
pfMatrix and pfDCS man pages. You can get the matrix of your DCS node:
pfMatrix DCSmat;
myDCS->getMat(&DCSmat);
You can build a rotation matrix:
pfMatrix myMat;
myMat.makeRot(90,0,0,1);
for example, which makes myMat into the matrix which rotates 90 degrees around
the positive Z axis at the origin.
Then you pre-multiply the DCS matrix by this rotation matrix and store the
results:
DCSmat.preMult(myMat);
myDCS->setMat(DCSmat);
Hope this helps. Happy Performing.
Ed Peters
elpeters++at++ncsa.uiuc.edu
=======================================================================
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:54:13 PDT