예제 #1
0
        private void StartAnimation(AnimationNodeBase animationNode)
        {
            // First stop current animation and ...
            if (Camera1.AnimationController.IsAnimating)
            {
                Camera1.AnimationController.StopAnimation();
            }


            // NormalizeAngles normalizes the Heading, Attitude and Bank angles so that their values are between -180 and 180 (because normalizeTo180Degrees is true).
            // For example, this methods converts 390 value into 30. This prevent animating 390 to 40 instead of 30 to 40.
            Camera1.NormalizeAngles(normalizeTo180Degrees: true);


            // ... clear any existing AnimationNodes
            Camera1.AnimationController.AnimationNodes.Clear();

            // Set animation speed with setting FramesPerSecond.
            // Though this value does not have any effect on rendering, its default value is set to 60.
            // But with setting the FramesPerSecond to 100, it is easier to define the FrameNumber values for KeyFrames,
            // for example FrameNumber = 300 is at 3rd second; FrameNumber = 500 is at 5th second, etc.
            Camera1.AnimationController.FramesPerSecond = 100;

            Camera1.AnimationController.AutoRepeat        = false;
            Camera1.AnimationController.AutoReverse       = false;
            Camera1.AnimationController.AutoStopAnimation = true;


            // Add the CameraAnimationNode to animation controller
            Camera1.AnimationController.AnimationNodes.Add(animationNode);

            // And start the animation
            Camera1.AnimationController.StartAnimation();
        }
예제 #2
0
        private void StartAnimation(AnimationNodeBase animationNode)
        {
            // First stop current animation and ...
            if (_animationController.IsAnimating)
            {
                _animationController.StopAnimation();
            }


            // NormalizeAngles normalizes the Heading, Attitude and Bank angles so that their values are between -180 and 180 (because normalizeTo180Degrees is true).
            // For example, this methods converts 390 value into 30. This prevent animating 390 to 40 instead of 30 to 40.
            Camera1.NormalizeAngles(normalizeTo180Degrees: true);


            // ... clear any existing AnimationNodes
            _animationController.AnimationNodes.Clear();


            // Add the CameraAnimationNode to animation controller
            _animationController.AnimationNodes.Add(animationNode);

            // And start the animation
            _animationController.StartAnimation();


            // We can get details about the animation with calling GetDumpString method on AnimationController or any other animation related class.
            // It is also possible to call Dump method in the Visual Studio immediate method. This will dump the details to the same window.
            DumpTextBox.Text = _animationController.GetDumpString();
        }