Exemplo n.º 1
0
        private void Start(Graphics g)
        {
            List <Vector> vb;

            vb = Transformations.ViewTransformation(_xAxis.vb);
            vb = Transformations.ProjectionTransformation(vb);
            vb = Transformations.ViewPortTransformation(800, 600, vb);
            _xAxis.Draw(g, vb);

            vb = Transformations.ViewTransformation(_yAxis.vb);
            vb = Transformations.ProjectionTransformation(vb);
            vb = Transformations.ViewPortTransformation(800, 600, vb);
            _yAxis.Draw(g, vb);

            vb = Transformations.ViewTransformation(_zAxis.vb);
            vb = Transformations.ProjectionTransformation(vb);
            vb = Transformations.ViewPortTransformation(800, 600, vb);
            _zAxis.Draw(g, vb);
        }
Exemplo n.º 2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            List <Vector> vb;

            base.OnPaint(e);

            Start(e.Graphics);

            PhiLabel.Text     = Transformations.phi.ToString();
            ThetaLabel.Text   = Transformations.theta.ToString();
            ScaleLabel.Text   = Math.Round(_scale, 2).ToString();
            RotateXLabel.Text = _xRotation.ToString();
            RotateYLabel.Text = _yRotation.ToString();
            RotateZLabel.Text = _zRotation.ToString();
            RLabel.Text       = Transformations.r.ToString();
            DLabel.Text       = Transformations.d.ToString();

            vb = Transformations.ViewTransformation(_c.Vertexbuffer);
            vb = Transformations.ProjectionTransformation(vb);
            vb = Transformations.ViewPortTransformation(800, 600, vb);

            CalculateScale(_c.Vertexbuffer[0], _c.Vertexbuffer[1]);
            _c.Draw(e.Graphics, vb);
        }