Exemple #1
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // reduce flicker

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            CreateCube();

            TheCube = (ThreeDObject)((ICloneable)TheCubeOriginal).Clone();             // recopy original object
            point1  = (ThreeDPoint)((ICloneable)point1or).Clone();
            point2  = (ThreeDPoint)((ICloneable)point2or).Clone();
            timer1.Start();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            point.Scale(100);
            point.Translate(new float[] { 150, 150, 0 });
            point1.Scale(100);
            point1.Translate(new float[] { 150, 150, 0 });
            point2.Scale(100);
            point2.Translate(new float[] { 150, 150, 0 });
            createNetwork();
            point1or = (ThreeDPoint)((ICloneable)point1).Clone();
            point2or = (ThreeDPoint)((ICloneable)point2).Clone();
        }
Exemple #2
0
        private void createNetwork()
        {
            ThreeDPoint point1 = new ThreeDPoint(0, 0, 1);
            ThreeDPoint point2 = new ThreeDPoint(1, 0, 0);
            ThreeDPoint point  = new ThreeDPoint(0, 0, 0);

            point.Scale(100);
            point.Translate(new float[] { 150, 150, 0 });
            points.Add(point);
            point1.Scale(100);
            point1.Translate(new float[] { 150, 150, 0 });
            points.Add(point1);
            point2.Scale(100);
            point2.Translate(new float[] { 150, 150, 0 });
            points.Add(point2);
        }