コード例 #1
0
        /// <summary>
        /// Sets the scale of this Tranform3D instance to the specified ScaleTransform3D instance.
        /// </summary>
        /// <param name="scale">The scale to be applied</param>
        public void SetScale(ScaleTransform3D scale)
        {
            // Find and remove all scale transforms
            var scales = GetTransforms <ScaleTransform3D>();

            foreach (var item in scales)
            {
                Children.Remove(item);
            }
            Children.Add(new ScaleTransform3D(scale.ScaleX, scale.ScaleY, scale.ScaleZ));
        }
コード例 #2
0
        //------------------------------------------------------
        //
        //  Scaling Modifiers
        //
        //------------------------------------------------------

        #region Scaling Modifiers

        /// <summary>
        /// Scales this Tranform3D instance by the specified ScaleTransform3D instance.
        /// </summary>
        /// <param name="scale">The scale to be applied</param>
        public void ScaleBy(ScaleTransform3D scale)
        {
            // Have to add 1 to make the transformation additive!
            Children.Add(new ScaleTransform3D(scale.ScaleX + 1, scale.ScaleY + 1, scale.ScaleZ + 1));
        }