CenterZ Property
Collapse the table of content
Expand the table of content

RotateTransform3D.CenterZ Property

 

Gets or sets the Z coordinate of the Point3D about which to rotate.

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

public double CenterZ { get; set; }

Property Value

Type: System.Double

Double that represents the Z coordinate of the Point3D about which to rotate.

The following code uses this property to change the point around which a RotateTransform3D transforms the model.

public void AddAnimation(object sender, EventArgs e)
{
    if ((bool)CenterAnimCheck.IsChecked == true)
    {
        //Shift point around which model rotates to (-0.5, -0.5, -0.5).
        myHorizontalRTransform.CenterX = -0.5;
        myHorizontalRTransform.CenterY = -0.5;
        myHorizontalRTransform.CenterZ = -0.5;
    }
    if ((bool)CenterAnimCheck.IsChecked != true)
    {
        //Set point around which model rotates back to (0, 0, 0).
        myHorizontalRTransform.CenterX = 0;
        myHorizontalRTransform.CenterY = 0;
        myHorizontalRTransform.CenterZ = 0;
    }
}

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft