This documentation is archived and is not being maintained.

Point3DAnimation Class

Animates the value of a Point3D property using linear interpolation between two values.

Namespace:  System.Windows.Media.Animation
Assembly:  PresentationCore (in PresentationCore.dll)

public class Point3DAnimation : Point3DAnimationBase
<Point3DAnimation .../>

An animation updates the value of a property over a period of time. An animation effect can be subtle, such as moving a Shape a few pixels left and right, or dramatic, such as enlarging an object to 200 times its original size while spinning it and changing its color. To create an animation in Windows Presentation Foundation (WPF), you associate an animation with an object's property value.

Target Values

The Point3DAnimation class creates a transition between two target values. To set its target values, use its From, To, and By properties.  The following table summarizes how the From, To, and By properties may be used together or separately to determine an animation's target values.

Properties specified

Resulting behavior


The animation progresses from the value specified by the From property to the base value of the property being animated or to a previous animation's output value, depending on how the previous animation is configured.

From and To

The animation progresses from the value specified by the From property to the value specified by the To property.

From and By

The animation progresses from the value specified by the From property to the value specified by the sum of the From and By properties.


The animation progresses from the animated property's base value or a previous animation's output value to the value specified by the To property.


The animation progresses from the base value of the property being animated or a previous animation's output value to the sum of that value and the value specified by the By property.


If you set both the To and By properties, the To property takes precedence and the By property is ignored.

To use other interpolation methods or animate between more than two target values, use a Point3DAnimationUsingKeyFrames object.

For information about applying multiple animations to a single property, see Key-Frame Animations Overview.

Freezable Features

Because the Point3DAnimation class inherits from Freezable, Point3DAnimation objects gain several special features, which include the following: they can be declared as resources, shared among multiple objects, made read-only to improve performance, cloned, and made thread-safe. For more information about the different features provided by Freezable objects, see the Freezable Objects Overview.

The following example shows how to animate the position of a camera and animate the direction it is pointing in a 3D scene. This is done by using Point3DAnimation and Vector3DAnimation to animate the Position and LookDirection properties respectively of the PerspectiveCamera. You might use an animation like this to change the onlooker's view of a scene in response to an event.

<Page xmlns=""
  xmlns:x="" >
      <Canvas Width="321" Height="201">

        <Viewport3D Name="MyAnimatedObject"
          ClipToBounds="True" Width="150" Height="150"
          Canvas.Left="0" Canvas.Top="10">

          <!-- Defines the camera used to view the 3D object. The position and direction of this 
               camera is animated in the Storyboard below. -->
            <PerspectiveCamera x:Name="myPerspectiveCamera" Position="0,0,2" LookDirection="0,0,-1" 
             FieldOfView="45" />

              <!-- This resource defines the 3D cube that is used in this example.-->
              <StaticResource ResourceKey="PictureCubeModelVisual3DResource" />

            <EventTrigger RoutedEvent="Viewport3D.Loaded">

                  <!-- This animation moves the camera around the object. The object is not
                       changing position or rotating but moving the camera makes it appear that
                       it is.-->
                   From="0,0,2" To="1,2,3" Duration="0:0:4" RepeatBehavior="Forever"/>

                  <!-- As the position of the camera changes using the Point3DAnimation
                       above, the direction the camera is pointing swivels to keep the object
                       within the view of the camera. -->
                   From="0,0,-1" To="-1,-2,-3" Duration="0:0:4" RepeatBehavior="Forever"/>



More Code

How to: Animate a Property Without Using a Storyboard This example shows one way to apply an animation to a property without using a Storyboard.
How to: Animate a Property by Using a Storyboard This example shows how to use a Storyboard to animate properties. To animate a property by using a Storyboard, create an animation for each property that you want to animate and also create a Storyboard to contain the animations.

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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0