David Plew (kishore++at++aimnet.com)
Thu, 1 May 1997 09:32:26 -0700 (PDT)
// To rotate the object about the given center, first translate
// it to the origin, rotate, then translate it back.
pfMatrix mat1, mat2, mat3, rot;
pfMakeTransMat(mat1, x, y, z) // object translation
pfMakeTransMat(mat2, -centerX, -centerY, -centerZ)
pfMakeTransMat(mat3, centerX, centerY, centerZ)
pfMakeScaleMat(scaleMat, sx, sy, sz)
pfMakeEulerMat(rot, h, p, r)
pfPostMultMat(mat2, rot);
pfPostMultMat(mat2, scaleMat);
pfPostMultMat(mat2, mat3);
pfPostMultMat(mat2, mat1);
pfDCSMat(dcs, mat2)
With the above code, I am able to rotate two doors about their hinges, which
looks like closing or opening the doors.
Hope this helps.
-anita
kishore++at++aimnet.com
=======================================================================
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:55:10 PDT