本文整理汇总了C#中System.Windows.Media.Media3D.RotateTransform3D.BeginAnimation方法的典型用法代码示例。如果您正苦于以下问题:C# RotateTransform3D.BeginAnimation方法的具体用法?C# RotateTransform3D.BeginAnimation怎么用?C# RotateTransform3D.BeginAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Media3D.RotateTransform3D
的用法示例。
在下文中一共展示了RotateTransform3D.BeginAnimation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAnimatedTransform2
private Media3D.Transform3D CreateAnimatedTransform2(Vector3D translate, Vector3D axis, double speed = 4)
{
var lightTrafo = new Media3D.Transform3DGroup();
lightTrafo.Children.Add(new Media3D.TranslateTransform3D(translate));
var rotateAnimation = new Rotation3DAnimation
{
RepeatBehavior = RepeatBehavior.Forever,
//By = new Media3D.AxisAngleRotation3D(axis, 180),
From = new Media3D.AxisAngleRotation3D(axis, 135),
To = new Media3D.AxisAngleRotation3D(axis, 225),
AutoReverse = true,
Duration = TimeSpan.FromSeconds(speed / 4),
//IsCumulative = true,
};
var rotateTransform = new Media3D.RotateTransform3D();
rotateTransform.BeginAnimation(Media3D.RotateTransform3D.RotationProperty, rotateAnimation);
lightTrafo.Children.Add(rotateTransform);
return lightTrafo;
}
示例2: CreateAnimatedTransform1
private Transform3D CreateAnimatedTransform1(Vector3D translate, Vector3D axis, double speed = 4)
{
var lightTrafo = new Transform3DGroup();
lightTrafo.Children.Add(new TranslateTransform3D(translate));
var rotateAnimation = new Rotation3DAnimation {
RepeatBehavior = RepeatBehavior.Forever,
By = new AxisAngleRotation3D(axis, 90),
Duration = TimeSpan.FromSeconds(speed / 4),
IsCumulative = true,
};
var rotateTransform = new RotateTransform3D();
rotateTransform.BeginAnimation(RotateTransform3D.RotationProperty, rotateAnimation);
lightTrafo.Children.Add(rotateTransform);
return lightTrafo;
}