Пример #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     TheCube = (ThreeDObject)((ICloneable)TheCubeOriginal).Clone(); // recopy original object
     point1  = (ThreeDPoint)((ICloneable)point1or).Clone();
     point2  = (ThreeDPoint)((ICloneable)point2or).Clone();
     TheCube.SortPolygonsInZOrder();
     TheCube.RotateAtZ(TheCube.GetCenter(), AngleCount);
     point1.RotateAtZ(TheCube.GetCenter(), AngleCount);
     point2.RotateAtZ(TheCube.GetCenter(), AngleCount);
     AngleCount += 20;
     Invalidate();
 }
Пример #2
0
        private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            OffsetWorldCoordinatesNegativeY(g);

            g.FillRectangle(Brushes.Black, ClientRectangle);
            TheCube.Draw(g);
            //g.DrawEllipse(Pens.Red, point.To2D(TheCube.GetCenter()).X, point.To2D(TheCube.GetCenter()).Y, 5F, 5F);
            g.DrawLine(Pens.White, point1.To2D(TheCube.GetCenter()), point2.To2D(TheCube.GetCenter()));
            //foreach (ThreeDPoint item in points)
            //{
            //    g.DrawEllipse(Pens.Red, item.To2D(TheCube.GetCenter()).X, item.To2D(TheCube.GetCenter()).Y, 5F, 5F);
            //}
        }
Пример #3
0
 private void button6_Click(object sender, EventArgs e)
 {
     TheCube = (ThreeDObject)((ICloneable)TheCubeOriginal).Clone(); // recopy original object
     TheCube.SortPolygonsInZOrder();
     TheCube.RotateAtXNegative(TheCube.GetCenter(), AngleCount);
     AngleCount += 20;
     Invalidate();
 }
Пример #4
0
 public void topView()
 {
     TheCube = (ThreeDObject)((ICloneable)TheCubeOriginal).Clone(); // recopy original object
     //TheCube.SortPolygonsInZOrder();
     TheCube.RotateAtX(TheCube.GetCenter(), AngleCount);
     AngleCount += 20;
     Invalidate();
 }
Пример #5
0
 private void button1_Click_1(object sender, System.EventArgs e)
 {
     TheCube = (ThreeDObject)((ICloneable)TheCubeOriginal).Clone();             // recopy original object
     TheCube.SortPolygonsInZOrder();
     TheCube.RotateAt(TheCube.GetCenter(), AngleCount);
     AngleCount += 1;
     Invalidate();
 }