how to rotate a 3d object
Hi all!
how can i rotate a 3d object in max using a device which is sending accelerometric, gyroscopic and magnetometric data?
I want it to have something like this:
https://www.youtube.com/watch?v=-mAiezshN9k
Thanks!
rotation in the form or quaternions, use the jit.gl.* quat attribute.
rotation in the form of angle and axis, use the jit.gl.* rotate attribute
rotation in the form of euler angles, use the jit.gl.* rotatexyz attribute
rotation in the form of axes, use the jit.quat xaxis, yaxis and zaxis attributes to construct a quaternion to send to jit.gl.* quat attribute.
oh, i guess my jitter level is so basic I can't quite get your answer Rob! ;-)
Need to go back to study (actually i never properly studied Jitter...)
So... is there any super-simple example from some acc/gyro/mag data to a moving cube i can study?
Couldn't really find anything basic on the forum for me to grasp.
Well personal I would just try stuff out !
The basics.
Now make the following objects
float float float
plug into
pak 0. 0. 0.
plug this into
prepend rotatexyz
plug that into
jit.gl.gridshape @shape cube @scale 1.5 1.0 0.8
(this creates a rotatexyz float float float message)
This allows you to control the rotation of the object with the mouse.
As Rob said you can replace the rotatexyz attribute with one of the others (rotation is a tricky beast to understand)
You can also try the following
float float float
to
pak 0. 0. 0.
to
prepend turn
to jit.anim.drive
to
jit.gl.gridshape @shape cube @scale 1.5 1.0 0.8
The rotation method you should use depends on the data coming in.