PDA

View Full Version : how to align pivot rotation?


marktsang
12-04-2004, 04:16 PM
hi,
i have searched the board for this one and found some answers ( a very good one by lfshade ) unfortunatly it didnt quite do what i wanted - i want to align and objects pivot rotation to another objects pivot rotation keeping the pivot position the same. using the methods i have found on the board leave me with the pivotpositon offset from the object. can someone please help me out here!

mark

PEN
12-06-2004, 05:06 PM
hi,
i have searched the board for this one and found some answers ( a very good one by lfshade ) unfortunatly it didnt quite do what i wanted - i want to align and objects pivot rotation to another objects pivot rotation keeping the pivot position the same. using the methods i have found on the board leave me with the pivotpositon offset from the object. can someone please help me out here!

mark
Can you just reset the position of the pivot back to what it was after doing the rotation?

marktsang
12-06-2004, 05:33 PM
hi pual,
no i can't read the pivot back because its not the pivot thats offset but the object ( as if i used affect object only ) . oh well..
mark

magicm
12-06-2004, 06:14 PM
Have you tried aligning it manually using "Affect Pivot Only" ?

marktsang
12-06-2004, 08:04 PM
hi magicm,
i need to do it through maxscript, its part of a rig and needs to be done through MXS.

mark

EverZen
12-08-2004, 02:03 PM
as I understand it, you are looking to align the roation of an objects pivot to another objects pivot. These effectively deals with the rotation of both objects and the objects offset rotation.

--take the the first object (call it A) and record its rotation and objects offset rotation e.g

Arot = A.rotation -- can include "as eulerangles" to make things a bit more mamageable
Aoffsetrot = A.objectoffsetrot --offset of geometry in relation to its pivot....sort of.

--if you then apply the offset rotion to the second object (called B) then it will orientate the axis to the object in the same way as A. i.e

B.objectoffsetrot = Aoffsetrot

--This will rotate the geometry to align the pivot (not rotate the pivot), so you then rotate --the whole object to align the pivots :)....hope this is clear

rotate B Aoffsetrot

--The final orientation is simply rotating B by the roation that exsits on A (if this is needed)

That was very badly explained and probably not waht you want, but I hope it helps :)

Good luck m8,

rich

marktsang
12-13-2004, 01:54 PM
this is just a post for the benifit of any other maxscript newcomers..
i found the solution
say you want to aligh obj2's pivot to obj1's pivot
pivrot=obj1.rotation;

in coordsys local obj2.rotation*=pivrot;

obj2.objectoffsetrot*=pivrot;

obj2.objectoffsetpos*=pivrot;

good luck now!

mark tsang

CGTalk Moderation
01-20-2006, 12:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.