/// <summary> /// Sets the rotation of this Tranform3D instance to the specified RotateTransform3D instance. /// </summary> /// <param name="rotation">The rotation to be applied</param> public void SetRotation(EulerRotateTransform3D rotation) { // Find and remove all rotation transforms var rotations = GetTransforms <EulerRotateTransform3D>(); foreach (var item in rotations) { this.Children.Remove(item); } this.Children.Add(new EulerRotateTransform3D(rotation.AngleX, rotation.AngleY, rotation.AngleZ, rotation.Center)); }
//------------------------------------------------------ // // Rotation Modifiers // //------------------------------------------------------ #region Rotation Modifiers /// <summary> /// Rotates this Tranform3D instance by the specified RotateTransform3D instance. /// </summary> /// <param name="rotation">The rotation to be applied</param> public void RotateBy(EulerRotateTransform3D rotation) { this.Children.Add(new EulerRotateTransform3D(rotation.AngleX, rotation.AngleY, rotation.AngleZ, rotation.Center)); }