Re: Rotation of a door and pfDCS

New Message Reply Date view Thread view Subject view Author view

David Plew (kishore++at++aimnet.com)
Thu, 1 May 1997 09:32:26 -0700 (PDT)


I have done something similar to what you need. My code takes care of
all transformation possible on an object about the specified center.
It is along the following steps:

            // 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


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:55:10 PDT

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