Compartir a través de


PlaneProjection.LocalOffsetZ Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the distance the object is translated along the z-axis of the plane of the object.

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

Syntax

'Declaration
Public Property LocalOffsetZ As Double
public double LocalOffsetZ { get; set; }
<PlaneProjection LocalOffsetZ="double"/>

Property Value

Type: System.Double
The distance the object is translated along the z-axis of the plane of the object.

Remarks

Dependency property identifier field: LocalOffsetZProperty

In contrast to GlobalOffsetX, GlobalOffsetY, and GlobalOffsetZ which translate an object along the axis of the screen, the LocalOffsetX, LocalOffsetY, and LocalOffsetZ properties translate an object along the respective axis of the plane of the object after it has been rotated. Therefore, the rotation of the object determines the direction that the object is translated. To demonstrate this concept, the following sample animates LocalOffsetX from 0 to 400 and RotationY from 0 to 65 degrees.

Run this sample

Notice in the preceding sample that the object is moving along the x-axis of the object. At the very beginning of the animation, when the RotationY value is near zero (parallel to the screen), the object moves along the screen in the x direction, but as the object rotates toward you, the object moves along the x-axis of the plane of the object toward you. On the other hand, if you animated the RotationY property to -65 degrees, the object would curve away from you.

LocalOffsetY works similarly to LocalOffsetX, except that it moves along the vertical axis, so changing RotationX affects the direction LocalOffsetY moves the object. In the following sample, LocalOffsetY is animated from 0 to 400 and RotationX from 0 to 65 degrees.

Run this sample

LocalOffsetZ translates the object perpendicular to the plane of the object as though a vector was drawn directly through the center from behind the object out toward you. To demonstrate how LocalOffsetZ works, the following sample animates LocalOffsetZ from 0 to 400 and RotationX from 0 to 65 degrees.

Run this sample

At the beginning of the animation, when the RotationX value is near zero (parallel to the screen), the object moves directly out toward you, but as the face of the object rotates down, the object moves down rather than toward you.

The following sample allows you to experiment with the different local offset properties.

Run this sample

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.