Exemplo n.º 1
0
        public Cube()
        {
            //上
            triangles[0] = new Triangle3D(a, b, c);
            triangles[1] = new Triangle3D(a, c, d);

            //下
            triangles[2] = new Triangle3D(e, h, f);
            triangles[3] = new Triangle3D(f, h, g);

            //前
            triangles[4] = new Triangle3D(d, c, g);
            triangles[5] = new Triangle3D(d, g, h);

            //后
            triangles[6] = new Triangle3D(a, e, b);
            triangles[7] = new Triangle3D(b, e, f);

            //右
            triangles[8] = new Triangle3D(b, f, c);
            triangles[9] = new Triangle3D(c, f, g);

            //左
            triangles[10] = new Triangle3D(a, d, h);
            triangles[11] = new Triangle3D(a, h, e);
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Vector4 a = new Vector4(0, 0.5, 0, 1);
            Vector4 b = new Vector4(0.5, -0.5, 0, 1);
            Vector4 c = new Vector4(-0.5, -0.5, 0, 1);

            t = new Triangle3D(a, b, c);
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            //Y方向是相反的
            Vector4 a = new Vector4(0, 0.5, 0, 1);
            Vector4 b = new Vector4(0.5, -0.5, 0, 1);
            Vector4 c = new Vector4(-0.5, -0.5, 0, 1);

            t = new Triangle3D(a, b, c);
            t.Transform(m_Scale);
        }
Exemplo n.º 4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.checkBoxX.Checked = false;
            this.checkBoxY.Checked = false;
            this.checkBoxZ.Checked = false;
            m_view[4, 3]           = this.trackBar1.Value = 500;

            Vector4 a = new Vector4(0, 0.5, 0, 1);
            Vector4 b = new Vector4(0.5, -0.5, 0, 1);
            Vector4 c = new Vector4(-0.5, -0.5, 0, 1);

            t = new Triangle3D(a, b, c);

            cube = new Cube();

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲
            //this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
            //this.UpdateStyles();
        }
Exemplo n.º 5
0
 public Cube()
 {
     //top
     triangles[0] = new Triangle3D(a, b, c);
     triangles[1] = new Triangle3D(a, c, d);
     //bottom
     triangles[2] = new Triangle3D(e, h, f);
     triangles[3] = new Triangle3D(f, h, g);
     //front
     triangles[4] = new Triangle3D(d, c, g);
     triangles[5] = new Triangle3D(d, g, h);
     //back
     triangles[6] = new Triangle3D(a, e, b);
     triangles[7] = new Triangle3D(b, e, f);
     //left
     triangles[8] = new Triangle3D(a, d, h);
     triangles[9] = new Triangle3D(a, h, e);
     //right
     triangles[10] = new Triangle3D(b, f, c);
     triangles[11] = new Triangle3D(c, f, g);
 }
Exemplo n.º 6
0
 private void Form1_Load(object sender, EventArgs e)
 {
     t = new Triangle3D(new Vector4(0, 0.5, 0, 1), new Vector4(0.5, -0.5, 0, 1), new Vector4(-0.5, -0.5, 0, 1));
 }