Notifications
Clear all

[Closed] Another Rotation Question

I was talking to another person the other day, and they were wondering how to make an object rotate according to TWO object’s rotation values – ie RotationofObjA+RotationofObjB=RotationObjC Basically I figured ok, since wire parameters only works with one object, how about either the expression controller or script controller. So I set forth to figure this out… well… I can get object c to rotate on it’s z axis via $Box01.rotation.z+$Box02.rotation.z BUT the units are not being converted properly… They aren’t influencing Object C as much as they should. If i rotate box1 to 90*, object c is about 30 * off… and if i animate box1 rotating 360*, object c just kind of goes back and forth and kind of snaps a little bit to into some values… the boxes are using default euler rotation with Bezier Float on each axis. As I understand it there is something going on with euler vs quat vs float? I thought doing <box1+2> as eulerAngles would work, but it can’t convert the float values or something… So does anybody know how to do this via the expression controller which i couldn’t figure out? or via the script controller? I would like it to update instantly (like wire parameters) rather than having to click a dif frame in the time slider for the script to update… Anybody have some ideas?

7 Replies

Not sure what you’re using this for, but is there are reason you can’t just use orientation constraints?

Stev

I’m not sure what anybody would be using it for either, but for me I think it’s more the learning aspect… The orientation controller works pretty well, but the weights throw it off… 90+90 should equal 180 not 90+90=45+45 which is what with two objects and weighting it comes out to.

I just tried this and it seemed to work okay. I put a rotation script controller on an object and entered this:

dependsOn $Point01 $Point02
$Point01.rotation + $Point02.rotation

hey – Thanks!I think that works – I’ve been doing it all wrong I think… added Float Script instead of just a script controller – Can I limit it to just the z axis?

To do one axis you could do it with a float expression controller on the Z Rotation only. Make two scalar variables and assign them to each of the obects you want to be controlling it. Then the expression would just be variableA + variableB.

Stev

!GASP! Thanks a bunch man… that works great! and much faster too… dunno why i tried doing it the hard way. I was trying something like that earlier, but got a little confused on scalar and vector – I’ll read up on it tonight. Thanks again!

No Problem. Have fun.

Stev