Ejemplo n.º 1
0
        private void UpdateParseXYZWSettings(object sender, EventArgs e)
        {
            //Clear prior values
            myprocTransformGroup.Children.Clear();
            XAxisValue.Clear();
            YAxisValue.Clear();
            ZAxisValue.Clear();
            AngleValue.Clear();

            //<SnippetQuaternionView3DN3>
            try
            {
                endQuaternion = Quaternion.Parse(ParseValue.Text);
            }
            catch
            {
                ParseValue.Text = "Must input (X, Y, Z, W)";
            }

            endRotation.Quaternion = endQuaternion;
            //</SnippetQuaternionView3DN3>

            //Update axis and angle textboxes
            XAxisValue.Text = endQuaternion.Axis.X.ToString();
            YAxisValue.Text = endQuaternion.Axis.Y.ToString();
            ZAxisValue.Text = endQuaternion.Axis.Z.ToString();
            AngleValue.Text = endQuaternion.Angle.ToString();

            startAnimation();
        }
Ejemplo n.º 2
0
        private void UpdateWXYZSettings(object sender, EventArgs e)
        {
            //Clear prior values
            myprocTransformGroup.Children.Clear();
            XAxisValue.Clear();
            YAxisValue.Clear();
            ZAxisValue.Clear();
            AngleValue.Clear();

            //<SnippetQuaternionView3DN2>
            //Read new settings
            Double setW = System.Convert.ToDouble(WValue.Text);
            Double setX = System.Convert.ToDouble(XValue.Text);
            Double setY = System.Convert.ToDouble(YValue.Text);
            Double setZ = System.Convert.ToDouble(ZValue.Text);

            endQuaternion          = new Quaternion(setX, setY, setZ, setW);
            endRotation.Quaternion = endQuaternion;

            //Update axis and angle textboxes
            XAxisValue.Text = endQuaternion.Axis.X.ToString();
            YAxisValue.Text = endQuaternion.Axis.Y.ToString();
            ZAxisValue.Text = endQuaternion.Axis.Z.ToString();
            AngleValue.Text = endQuaternion.Angle.ToString();

            startAnimation();
            //</SnippetQuaternionView3DN2>
        }