本文整理匯總了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;
}