WPF 3D -4- (Rotation3DAnimation)

索引サイト
DoubleAnimation Angle 操作で迷路。結局 Rotation3DAnimation で作成




AxisAngleRotation3D w_rotateAxis = new AxisAngleRotation3D(w_vector3d, 90);
Rotation3DAnimation w_rotateAnimation = new Rotation3DAnimation();
w_rotateAnimation.By = w_rotateAxis;
w_rotateAnimation.Duration = new TimeSpan(0, 0, z_second);
z_RotateTransform3D[w_targetCube].BeginAnimation(RotateTransform3D.RotationProperty, w_rotateAnimation);

リセット部分↓




private void buttonReset_Click(object sender, RoutedEventArgs e)
{
for (int idx = 0; idx < 27; idx++)
{
AxisAngleRotation3D w_rotateAxis = new AxisAngleRotation3D(new Vector3D(0,0,0),0);
Rotation3DAnimation w_rotateAnimation = new Rotation3DAnimation();
w_rotateAnimation.To = w_rotateAxis;
w_rotateAnimation.Duration = new TimeSpan(0, 0, 5);
z_RotateTransform3D[idx].BeginAnimation(RotateTransform3D.RotationProperty, w_rotateAnimation);

}
}



AX