EntityParent() still causes rotation

BlitzMax Forums/MiniB3D Module/EntityParent() still causes rotation

ima747(Posted 2009) [#1]
I know it's a known issue that due to the euler angles used when you change an entity's parent you get some weird rotation. Are there any workarounds? I figured setting the entity's global rotation after parenting would work but no dice.


_Skully(Posted 2009) [#2]
I believe you are looking for Quaternions

http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation


ima747(Posted 2009) [#3]
There looks like a thread with some updated maths for quats that I've been looking at but I'd rather avoid an overhaul of minib3d if I can at the moment.

I assume that since it's caused by the eulers and that's the core of the rotation system there's really no way to fudge it...


_Skully(Posted 2009) [#4]
Your going to be fraught with gimbal lock if your using pitch that rolls right over


ima747(Posted 2009) [#5]
I'm not using more than about 30 degrees of rotation in any direction on the parent and for other reasons I'm unwinding the rotation on the child entitys so gimbal lock is not really my concern, it's just the twitch when I parent and the inability to set it back to it's previous global rotation to nullify that twitch.


ima747(Posted 2009) [#6]
atleast for my uses I seem to have eliminated almost all of the noticeable twitch. I grab the child entity's global rotations, then change it's parent, then use turn entity on the change from the old global to the new global rotations. It's ugly and probably only works if your parent rotations are small and is probably prone to gimbal lock but it's better than nothing for my needs. I'll post a code snippet if anyone is interested (not on my code machine at the moment...)