views:

145

answers:

0

I'm trying to use WPF integrated 3D classes to rotate a WPF 3D model. I'm stuck. I'm looking for the 10 or so C# instructions which in pure 3D WPF would rotate a model based on Euler's angles as input (yaw, pitch, roll):

RotateTransform3D myTransform = TheSolution (yaw, pitch, roll)

I'd then use myTransform to rotation myModel (myModel.Transform = myTransform). Any suggestion to write the method TheSolution() using only WPF 3D classes? Though I have browsed a lot of pages that claim they do provide this solution, actually they don't.

I know this is not Euler's but Tait-Bryan's. Everybody names this representation "Euler's", so do I, to not start a confusion, even if the difference is quite significant. Euler's representation uses rotations around fixed axes while Tait-Bryan uses rotation for pitch and roll around previously rotated axes. Maybe Tait-Bryan is a member of the Euler's family, maybe it's a pure stranger, the relationship between these conventions is not clear to me.

It would be easy if it were actually Euler constuction, a matter of combining in the proper order three rotations around known axes. But with yaw, pitch, roll, the pitch rotation has to be executed around the cross product of Y (assuming a standard left handed system) and old Z now rotated by yaw in the XZ plan, same additional complexity for roll. I do hope we can use the 3D framework of WPF to directly obtain a Transformation3D object (or group) from Euler's triplet, without computing manually rotation axes.

By the way, I don't want to use a library to convert Euler's angles to a matrix or a quaternion, like it is done here: http://www.monroedavis.com/robert/code/cs/ (this library is handy, I used it, but I hope we have a more direct way with WPF 3D)