Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RotateTransform3D Class

Specifies a rotation transformation.

Namespace: System.Windows.Media.Media3D
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public sealed class RotateTransform3D : AffineTransform3D
public final class RotateTransform3D extends AffineTransform3D
public final class RotateTransform3D extends AffineTransform3D
<RotateTransform3D .../>

Rotations in 2-D usually consist of two arguments: a point around which to rotate an object or set of objects, and a value in degrees or radians that determines the amount of rotation. In 3-D, it is necessary to specify a Vector3D rather than a point around which to rotate.

Rotations in 3-D become more complicated when they are animated. To animate a 3-D rotation using RotateTransform3D, you can animate the Angle or Axis properties of an AxisAngleRotation3D, or specify a QuaternionRotation3D for the transform..

Axis/angle rotations in Windows Presentation Foundation (WPF) 3-D are specified in degrees, not radians.

//Define a rotation
RotateTransform3D myRotateTransform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 1));

<ModelVisual3D>
  <ModelVisual3D.Content>
    <GeometryModel3D Geometry="{StaticResource myTeapot}">
      <GeometryModel3D.Material>
        <DiffuseMaterial>
          <DiffuseMaterial.Brush>
            <SolidColorBrush Color="Blue" Opacity="1.0" />
          </DiffuseMaterial.Brush>
        </DiffuseMaterial>
      </GeometryModel3D.Material>
      <GeometryModel3D.Transform>
        <RotateTransform3D>
          <RotateTransform3D.Rotation>
            <AxisAngleRotation3D x:Name="myAngleRotation" Axis="0,3,0" Angle="1" />
          </RotateTransform3D.Rotation>
        </RotateTransform3D>
      </GeometryModel3D.Transform>
    </GeometryModel3D>
  </ModelVisual3D.Content>
</ModelVisual3D>

More Code

How to: Animate a 3-D Rotation Using Storyboards

The following example shows how to make a 3D object rotate while it "wobbles" by animating the Angle and Axis properties of an AxisAngleRotation3D object. This AxisAngleRotation3D object specifies the rotation transform of the 3D object and so animating its properties creates the desire rotation effect. Within the Storyboard, DoubleAnimation is used to animate the Angle property while Vector3DAnimation is used to animate the Axis property.

System.Object
   System.Windows.Threading.DispatcherObject
     System.Windows.DependencyObject
       System.Windows.Freezable
         System.Windows.Media.Animation.Animatable
           System.Windows.Media.Media3D.Transform3D
             System.Windows.Media.Media3D.AffineTransform3D
              System.Windows.Media.Media3D.RotateTransform3D

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft