## Creating rotating geometry from euler angles?

Nov 30 2012 | 8:38 am
I recently got an X-IMU motion sensor(http://www.x-io.co.uk), and am setting it up to use on Mac (it comes with windows GUI control/output).
Part of what I want to do is be able to visually see the state of the sensor in Max. Like this:
I'm assuming it's possible, but how difficult is that to pull off in Jitter? In terms of the actual rotating shape, ideally with the same graphic overlays.
(my math isn't great...nor is my jitter....hence why I'm asking how hard this is to do)

• Nov 30 2012 | 8:42 am
Sure, can be done. I do something similar with my accelerometers. You mention euler angles. Is that the output of your sensors?
• Nov 30 2012 | 8:54 am
It can spit out raw/calibrated data for each axis of each sensor (16bit 3axis gyro, 12bit 3axis accel, 12bit 3axis mag) as well as euler (and I believe quaternion too (if that's different from euler).
The sensor basically does all the fusion algorithm stuff onboard, so it can spit out absolute angles on it's own.
• Dec 01 2012 | 4:19 pm
Looks like the angles coming in (from the euler stuff) are -180 to 180, -90 to 90, and -180 to 180
I've mapped it to a multislider looking thing and for the most part the angles kind of seem to make sense to the way it's physically moving, but it's obviously been flattened to a 2D display.
• Dec 01 2012 | 4:42 pm
You can use both the euler and quat rotation pretty much straight on jitter opengl (3d) objects. Convert euler to degrees and use on jit.gl objects 'rotatexyz' attribute. Or take the quat rotation, convert to axis-angle format with [jit.quat2axis] and use on the 'rotate' attribute. The latter should save you from the singularities occurring with euler angles. With this you should be able to visualize your sensor rotation in 3d quite easily.
Btw, i thought ob3d objects could take quat rotations directly but I don't find that in the reference right now.
• Dec 01 2012 | 4:45 pm
Ah! See, I'm not crazy... It's the [jit.anim.node] object that has a quat rotation attribute. So you could link your jit.gl shape to a node and input the quat data there.
• Dec 01 2012 | 5:15 pm
Hmm. A bit over my head for the time being.
I've bookmarked all the objects to have a more thorough look though.
• Dec 02 2012 | 11:28 am