Hello everyone, Im designing a simple sit object that changes its rotation based upon where the sitting avatar is looking in mouselook, but I have run into a problem regarding local/global rotational math, and I was hoping somebody could help me out.
The problem is this, the script works fine when looking between a certain cone around the <0,0,0,0> axis, but when you try to stray too far from this point, it becomes very sporadic and buggy. Assuming rot equals the rotation of the sitting avatar, I am essentially doing llSetRot(rot); which should be rather axis independent and truly point in the way the avatar was looking, but I find it to act strangely when looking at different rotations, especially west.
I have noticed that at different global rotations, the x/y/z rotation axis of the objects seem to have different effects on the object while using llSetRot(), for example, x rotation may control the up/down pitch of an object while pointing east, but controls roll when pointing north (which makes sense if it is using a global rotational system) so I believe I can fix my problem in either of 2 ways.
-Find a way to set rotations based upon local instead of global rotational axis
or
-Figure out the math that computes which rotational axis to modify to change the roll of the object depending on the current global rotation.
If anybody who could offer help or just shed some light on the system, I would greatly appreciate it.
-Kokiri