Rotate an object in its own coordinate system… probably basic but I can't find
I’m beginning using jitter, and I have some problems understanding coordinates systems and basic operations on it in 3D view.
I looked at Max help, forums and website, but I can’t find a way to make a rotation of an object, using floats driven by knobs, of a 3D object, around its own axis.
In the following patch :
– I put a platonic solid in the world "Landscape" ;
– Landscape axes and Plato axes are on ;
– and I would like to rotate Plato axis around its own x-axis only (i.e. its red axis) ; then move it around y-axis (i.e. its blue one) without having any other rotations around x- or z-axis.
Actually, by hitting "reset" and rotating around X-Plato, the behavior is what I expect. But if then I change only Y-axis value, Plato is turning around an unknown axis…
Can you help please ?
Also, if you have good ressources to explain the camera system and position, and the cooridnates system in jitter (world and object), it would be very usefull. I’m confused with rotate/rotatexyz…
Thanks a lot.
I highly recommend going through the tutorials in Max for Jitter. They are really excellent.
Help menu->jitter tutorials.
Tutorial 30 and 32 provide good reading and examples you can learn from step by step.
Thanks for your quick reply !
I had again a carefull look at these two tutorials, but I can’t find a way to do what I want… rotation of the object with mouse is okay, but I do not see how to block two axis and make the rotation only around one of them, with mouse or better with seperate dials (1 for each axis).
I continue searching…
(and by the way, yes, Max tutorials are really excellent… that’s part of the big effieciency of the environment)
( if Cyclin’ can had a graphical view with definition of common notions in jitter/OpenGL, that would be nice :) )
I think, Tutorial 30 has very close to what you are seeking. Take a look at it again.
Right side, light blue area, a pak combining angle, x, z, y into a rotate message.
This does a angle of rotation around a rotation vector/axis
The rotatexyz message does a euler rotation around the traditional X Y Z axis. In Max 6, the default is to do Y first, Z second, and X third.
perhaps make some dials, get theiir output values, combine into a message like rotatexyz
I had a new look on Tutorial 30 – you’re right, it’s close, but I’m not able to rotate the text along one of its axis only, after having made a first rotation.
Let’s say after showing the axes, I give an angle then define x= 1. Okay, good movement.
Then how do I say : "move only around green axis, keeping the x-orientation as previously defined" ?
I keep trying with rotatexyz, rotate order, on the jti.gl.render object ; I try to understand the jit.gl.camera, lookat, position, etc… on both jit.gl.render and jit.gl.camera.
I think I don’t understand the basic theory of cam/world etc. ; and from what I get from the tutorials and Internet, I can’t from the moment understand how this work.
Start simple. Worry about camera, world, and other things later.
Every rotatexyz message you send sets the attribute called "rotatexyz". You can see it in the inspector for the object. Sending a message or setting it in the inspector completely negates any previous setting. So, if you want to do two rotations, then you must combine them together in the same message.
Its just like the color attribute. If you send it the RGBA value "1. 0. 0. 1." then it will make the object red. Now if you send it the color "0. 1. 0. 1." it will be green. It doesn’t combine the two colors together…it forget the previous color and uses the new one.
rotatexyz is exactly the same.
After you master rotating single objects, there are some other things you can do with jit.anim.node
Okay, I removed everything from my mind except "rotatexyz", and message combination :)
In a previous patch I did a control of the color attribute that worked fined (update of only one channel, keeping others at the same value).
I tried here with rotate xyz, I can’t make it…
Let say I have an object on screen (plato), with both axis rendered : screen and world.
I put attrui on the jit.gt.plat, looking at rotatexyz. I change the value to 45. 45. 45.
Now I change only x value on attrui-rotatexyz : rotation around x-object axis, perfect.
But if I change only Y or Z value, nok : rotation axis are different from object ones. It looks like there are world ones. But for X it’s always ok.
I do no know the combination I have to make…
"Let say I have an object on screen (plato), with both axis rendered : OBJECT and world."
thanks ! :)
I think there is a gap between what you want and what I’m understanding you want. I’m unsure how to help you. Could you draw on a piece of paper or video what you want, scan it, and post it here?
encelade, you need to use the anim_turn message, and change the @anim_mode attribute from the default of "parent" to "local".
this allows you to rotate around specific local axes.
this patch should explain it.
<code>-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1015.3oc0X1sahiCEG+Z3ovJZursJNDGH6U7Tr2rZExA6FbUvl01ok1Qy695 uRG5TRZFFvvJgRHNN1myu7+b7w4aSmjTI1SUIf+D72fIS91zISbMYaXR35II aw6W2fUttkrVrcKkqStyeOMcu10Nly1h0T.Fnakb.VJZ4Dvq2i2yTcctpspp gZ6NLzBucKi2P0pCa7QAWqXu46X1Co+nuhVcWm6ZcmjpL1CVyD7UR5Zs2YJJ rOHXl64AogCf+oaJj0UtQ48QeGVudCiWe3XLy8by7mxxftSnCFFFw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tvepC -----------end_max5_patcher-----------
Diablodale, sorry for reply late, my post was not send, I thought it was…
I prepared 3 pictures for the problem and an explanation.. :)
Rob, yes this is what I wanted – perfect, and perfect patch !
Thanks a lot to both of you for your help :)
oh……that was your question.
Glad Rob recognized it. :-)
Forums > Jitter