Exemple #1
0
        /// <summary>
        /// Draws the polygons to the <see cref="System.Drawing.Graphics"/>.
        /// </summary>
        /// <param name="panel">The Panel</param>
        /// <param name="rotation">The Rotation Angle</param>
        /// <param name="tilt">The Tilt Angle</param>
        /// <param name="size">The Size</param>
        /// <param name="perspectiveAngle">The Perspective Angle</param>
        /// <param name="depth">The Depth</param>
        public void View(Panel panel, double rotation, double tilt, Size size, double perspectiveAngle, double depth)
        {
            if (panel == null)
            {
                return;
            }

            panel.Children.Clear();

            if (this.transform == null)
            {
                this.transform = new ChartTransform.ChartTransform3D(size);
            }
            else
            {
                this.transform.mViewport = size;
            }

            this.transform.Rotation         = rotation;
            this.transform.Tilt             = tilt;
            this.transform.Depth            = depth;
            this.transform.PerspectiveAngle = perspectiveAngle;
            this.transform.Transform();
            var eye = new Vector3D(0, 0, short.MaxValue);

            this.DrawBspNode3D(this.tree, eye, panel);
        }
Exemple #2
0
        /// <summary>
        /// Computes the BSP tree.
        /// </summary>
        /// <param name="perspectiveAngle">The Perspective Angle</param>
        /// <param name="depth">The Chart Depth</param>
        /// <param name="rotation">The Rotation Angle</param>
        /// <param name="tilt">The Tilt Angle</param>
        /// <param name="size">The Size</param>
        public void PrepareView(double perspectiveAngle, double depth, double rotation, double tilt, Size size)
        {
            if (this.transform == null)
            {
                this.transform = new ChartTransform.ChartTransform3D(size);
            }
            else
            {
                this.transform.mViewport = size;
            }

            this.transform.Rotation         = rotation;
            this.transform.Tilt             = tilt;
            this.transform.Depth            = depth;
            this.transform.PerspectiveAngle = perspectiveAngle;
            this.transform.Transform();
            this.tree = this.treeBuilder.Build();
        }