Ejemplo n.º 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)
            {
                this.Children.Remove(item);
            }

            this.Children.Add(new ScaleTransform3D(scale.ScaleX, scale.ScaleY, scale.ScaleZ, scale.Center));
        }
Ejemplo n.º 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!
            this.Children.Add(new ScaleTransform3D(scale.ScaleX + 1, scale.ScaleY + 1, scale.ScaleZ + 1, scale.Center));
        }