RotateTransform3D.CenterY Property

 

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

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

public double CenterY { get; set; }

Property Value

Type: System.Double

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

Identifier field

CenterYProperty

Metadata properties set to true

None

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: