PDA

View Full Version : Getting/setting an object's rotation the same way the transform type-in does


ivanisavich
07-13-2011, 01:04 AM
I'm having a hard time setting up some spinners, whose purpose is to get/set the absolute rotation of an object, exactly the way the transform type-in does.

Just getting the controller values doesn't return the same value as the transform type-in. Ie:


$.rotation.controller.value.x --not the same as the value shown in the transform type-in!


I need to both get AND set the value (ie, spin the spinner and have the respective rotation axis on the object updated the same way it would be updated if you spun the transform type-in spinner for each rotation axis).

Any ideas?

PiXeL_MoNKeY
07-13-2011, 03:10 AM
Try using the conversion methods from and to quat on the rotation.controller.value:(QuatToEuler2 $.rotation.controller.value).x-Eric
EDIT: And to set it I would use something like this:eul = (quattoeuler $.rotation.controller.value)
eul.x = 30
$.rotation.controller.value = eulertoquat eulIn my simple test both items set and get the proper value as shown in the TTI.

denisT
07-13-2011, 04:34 AM
I'm having a hard time setting up some spinners, whose purpose is to get/set the absolute rotation of an object, exactly the way the transform type-in does.


why do you have to match the values of type-in dialog? you can give to user more ... hmm ... intuitive way of rotation representation. "yaw-pitch-roll" is for example.

ivanisavich
07-13-2011, 05:05 AM
Thanks Eric! I'll give that a shot.

Denis, I'm trying to create something similar to the channel box for Maya. I want a place for the user to define rotation x/y/z values for an object, and it would be kind of confusing if the spinner values were different than the various transform type-in boxes in max.

denisT
07-13-2011, 05:16 AM
Thanks Eric! I'll give that a shot.

Denis, I'm trying to create something similar to the channel box for Maya. I want a place for the user to define rotation x/y/z values for an object, and it would be kind of confusing if the spinner values were different than the various transform type-in boxes in max.

the values in the type-in rotation dialog are already confusing. no one can imagine the orientation of an object as (eulerangels 103 -84 211).

CGTalk Moderation
07-13-2011, 05:16 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.