Is it just me or is the orientation data (from a tag) kinda broken when you break it down manally?
I've just been studying how the X, Y and Z rotations from a tag's Scene Space Transform behave and either there's some strange magic that I don't understand when it comes to 3D rotation or it just doesn't work correctly.
I suspect that maybe this is being converted from a quaternion and the conversion has been messed up but I'm certainly no expert on how that works so it is only a guess.
Try the following and if you can explain it, I'd be very grateful as I'm trying to work with the data on my current project:
1. Stamp down a shape with an obvious front and back so you can see the rotations. A thin, stretched wedge is good.
2. Microchip it and tag it. On the tag axes, set the Z to front and Y to up. X will be pointing left.
3. Give it a Controller Sensor and Advanced Rotator, set to world space. Make sure the rotators axes match the tag's. Hook your left stick (page 2 for camera relative) so your stick's Y is rotating around the X axis and your stick's X is rotating around Z. Now let your right stick's X output control the Y axis rotations.
3. Bung down 2 splitters and 3 sliders in the space somewhere you can see them clearly. Plug the tag's Scene Space Direction into the first splitter. Then from there, plug the Orientation A, B and C (or X, Y and Z, can't remember which) into your 3 sliders. Make sure the sliders have at least -360 to +360 range.
4. Go into Test. Pull back on the left stick and watch the X rotation slider. All seems well. Vertical is 90 degress and half way up is 45.
5. Go back to straight and level.
6. Now use your right stick to rotate 90 degrees to the right, so you're nose is facing right. You can see from your Y slider when you hit 90.
7. Once again, use the left stick to go vertical. Pull it left to raise the nose until your wedge is pointing straight up.
8. Voila, vertical is now 70 degrees! And you'll also notice that it says your Y rotation is also now 70 (while in fact it should still be 90) and you've rotated 70 degrees around your Z axis, when in fact you haven't rotated around the Z axis at all.
If you can tell me how to work with that, I'd be impressed, and very grateful. No wonder the trig stuff I've been trying falls flat on it's face!
-
The rotations that you get out of the rotation output of a splitter with a transform input certainly aren't Euler rotations. I haven't investigated the math of this yet, but perhaps they're axis-angle rotations, with the XYZ of the rotation being a vector whose length is the angle of the rotation in degrees and whose direction is the axis of rotation? MM might have chosen that form of rotation because converting between those and quaternions requires less math than converting between Euler rotations and quaternions.
-
The output of the Rotator gadgets is in radians per second, if that's any help.
-
Hi,
Yes you're correct BeardyMan, the splitter gives you an axis-angle representation of the rotation. We hope to also add Euler angle outputs in the future. Sorry for the confusion!
Matt -
Ok, thanks all. Time to go and remind myself of the vector math I did 25 years ago in school!
Accedi per aggiungere un commento.