[Closed] Interpolating between two quat values
Hi guys,
I need a way to blend between two rotation values using maxscript… e.g. calculate a rotation value that is somewhere between to object’s rotations
i tried some stuff but couldn’t really figure it out.
any help?
something like this in a rotation script wil give you the same effect as a 50 50 orientation contsraint between two objects
r1 = $obj1
r2 = $obj2
blah = r2.transform + r1.transform
blah.rotation as quat
mark tsang
slerp obj1.rotation obj2.rotation 0.5
The 3rd argument can go from 0.0 to 1.0, which causes the returned quaternions to go from the first rotation to the second rotation.
hey bobo,
is there a way to blend between two maxrix3 values?
cheers
mark
AFAIK not directly, but I assume you could blend the different components (rotationpart which is quat as shown above), the scalepart and the translations which are just Point3’s, and build a new matrix from those values…
thanks for the reply bobo,
yeah i thought as much – i was just hoping there was some magic matrix way i dont know of
cheers
mark
Apparently some irish goon invented quaternions – he got a moment of inspiration and scratched an equation into a bridge in clare so he didnt forget it – wonder is it still there?
thanks for the help guys, i figured it out now!
Bobo, you just posted the slerp function as is, Larry Minton on the discreet forum posted an additional function that he claimed is necessary for this to work correctly:
so is this actually needed?
Questioning Larry’s wisdom? Are you crazy?!?
If he says it is needed, it is needed.