It might be easier to use a container + your model for doing the rotations and keeping track of them. I do this for a flying game I'm working on. Basically, just separate out the banking to be in model space, and all other rotations to be in the container space.
On Apr 2, 2:47 pm, Julien <[email protected]> wrote: > Hi, i am trying to get the value of my Aircraft Lateral axis (in > degrees) compared with earth horizon, but the values are wrong when i > change the pitch of my aircraft. > You can look at my demo here > :http://www.timelessconcept.com/flashLab/sl/main.html > > If i roll when the pitch angle is 0, everything is fine, but when for > example, i go up to 25degrees in the air and roll, some values are > skiped... > > This is how i calculate the angle for now : > var aircraftLateralVector:Vector3d = > Matrix3DUtils.getRight( aircraft.transform ); > var worldLateralVector:Vector3D = > Matrix3DUtils.getRight( aircraft.transform ); > worldLateralVector.y = 0; > > aircraftLateralVector.normalize(); > worldLateralVector.normalize(); > > var dotProduct:Number = > aircraftLateralVector.dotProduct( worldLateralVector ); > > return Math.acos( dotProduct ) / Math.PI * 180; > > Do you have any suggestion ? > how would you get the aircraft lateral angle ? > > Thanks for any help.
