private void Form1_Resize(object sender, EventArgs e)
        {
            var _newCenter = new _3d();

            _newCenter.set(this.Width / 2, this.Height / 2, (this.Width + this.Height) / 2);

            for (var i = 1; i < _objects.Count; i++)
            {
                var oi = _objects[i];
                oi.p.x -= _center.x - _newCenter.x;
                oi.p.y -= _center.y - _newCenter.y;
                oi.p.z -= _center.z - _newCenter.z;
            }

            _center.set(this.Width / 2, this.Height / 2, (this.Width + this.Height) / 2);

            textBox1.SetBounds(textBox1.Location.X, this.Height - 100, textBox1.Width, textBox1.Height);
        }
Beispiel #2
0
        public void move()
        {
            this.p.x += this.v.x;
            this.p.y += this.v.y;
            this.p.z += this.v.z;
            var tmp = new _3d();

            tmp.set(this.p.x, this.p.y, this.p.z);

            //TAIL
            this.t.Reverse();
            this.t.Add(tmp);
            this.t.Reverse();

            if (this.t.Count > GLOBALS.TAIL_SIZE)
            {
                this.t.RemoveRange(GLOBALS.TAIL_SIZE, this.t.Count - GLOBALS.TAIL_SIZE);
            }
        }