July 2007
Intermediate to advanced
448 pages
13h 39m
English
The RotateTransform3D class defines a property named Rotation that you set to an object of type Rotation3D, which is an abstract class from which both AxisAngleRotation3D and QuaternionRotation3D descend. In previous chapters, I've shown only AxisAngleRotation3D. QuaternionRotation3D has a single property named Quaternion of type Quaternion. In XAML, it looks like this:
<RotateTransform3D>
<RotateTransform3D.Rotation>
<QuaternionRotation3D Quaternion="0 0 0.5 0.866" />
</RotateTransform3D.Rotation>
</RotateTransform3D>That's a rotation of 60 degrees around the Z axis or (0, 0, 1). The number 0.5 is the sine of half the angle (or 30 degrees), and 0.866 is the cosine of 30 degrees. Remember: In XAML, the w term comes last. You ...
Read now
Unlock full access