예제 #1
0
        private void UpdateVisuals()
        {
            Children.Clear();
            var frontColor = Brushes.Red;
            var rightColor = Brushes.Green;
            var upColor    = Brushes.Blue;
            var up         = ModelUpDirection;
            var right      = new Vector3D(0, 1, 0);

            if (up.Z != 1)
            {
                right      = new Vector3D(0, 0, 1);
                rightColor = Brushes.Blue;
                upColor    = Brushes.Green;
            }
            var front = Vector3D.CrossProduct(right, up);

            addFace(front, up, frontColor, "F");
            addFace(-front, up, frontColor, "B");
            addFace(right, up, rightColor, "R");
            addFace(-right, up, rightColor, "L");
            addFace(up, right, upColor, "U");
            addFace(-up, -right, upColor, "D");
            var circle = new PieSliceVisual3D()
            {
                Center      = (ModelUpDirection * (-Size / 2)).ToPoint3D(),
                Normal      = ModelUpDirection,
                UpVector    = ModelUpDirection.Equals(new Vector3D(0, 0, 1)) ? new Vector3D(0, 1, 0) : new Vector3D(0, 0, 1),
                InnerRadius = Size,
                OuterRadius = Size * 1.3,
                StartAngle  = 0,
                EndAngle    = 360,
                Fill        = Brushes.Gray
            };

            Children.Add(circle);
        }
예제 #2
0
        private void UpdateVisuals()
        {
            Children.Clear();
            var frontColor = Brushes.Red;
            var rightColor = Brushes.Green;
            var upColor = Brushes.Blue;
            var up = ModelUpDirection;
            var right = new Vector3D(0, 1, 0);
            if (up.Z != 1)
            {
                right = new Vector3D(0, 0, 1);
                rightColor = Brushes.Blue;
                upColor = Brushes.Green;
            }
            var front = Vector3D.CrossProduct(right, up);

            addFace(front, up, frontColor, "F");
            addFace(-front, up, frontColor, "B");
            addFace(right, up, rightColor, "R");
            addFace(-right, up, rightColor, "L");
            addFace(up, right, upColor, "U");
            addFace(-up, -right, upColor, "D");
            var circle = new PieSliceVisual3D()
                            {
                                Center = (ModelUpDirection * (-Size / 2)).ToPoint3D(),
                                Normal = ModelUpDirection,
                                UpVector = ModelUpDirection.Equals(new Vector3D(0, 0, 1)) ? new Vector3D(0, 1, 0) : new Vector3D(0, 0, 1),
                                InnerRadius = Size,
                                OuterRadius = Size * 1.3,
                                StartAngle = 0,
                                EndAngle = 360,
                                Fill = Brushes.Gray
                            };
            Children.Add(circle);
        }