Пример #1
0
        private Conical GetConical(float scaleFactor,
                                   float r, float g, float b)
        {
            var conical = new Conical();

            conical.SideCount = 100;
            conical.Texture   = new ColorTexture(r, g, b, 1.0f);
            conical.Material  = GetMaterial();
            conical.Transform = GetScalingAndRandomTranslation(scaleFactor);
            return(conical);
        }
Пример #2
0
        public void Draw()
        {
            if (chedo == 1) // hinh tru
            {
                Cylindrical c = new Cylindrical(Height1 * 5, Length * 5, X * 5, Y * 5, Z * 5);
                c.Draw(g);

                this.form1.AX1.Text = "( " + x + " , " + y + " , " + z + " )";


                this.form1.BX1.Text = "( " + x + " , " + y + " , " + (z + Height1) + " )";


                this.form1.CX1.Text = "-";


                this.form1.DX1.Text = "-";


                this.form1.EX1.Text = "-";


                this.form1.FX1.Text = "-";


                this.form1.HX1.Text = "-";


                this.form1.JX1.Text = "-";
            }
            else if (chedo == 2)//hinh non
            {
                Conical c = new Conical(Length * 5, Height1 * 5, x * 5, y * 5, z * 5, Color.Black);
                c.Draw(g);

                this.form1.AX1.Text = "( " + x + " , " + y + " , " + (z + Height1) + " )";


                this.form1.BX1.Text = "-";


                this.form1.CX1.Text = "-";


                this.form1.DX1.Text = "-";


                this.form1.EX1.Text = "-";


                this.form1.FX1.Text = "-";


                this.form1.HX1.Text = "-";


                this.form1.JX1.Text = "-";
            }
            else if (chedo == 3)//box
            {
                Box b = new Box(Length * 5, X * 5, Y * 5, Z * 5, Color.Black);
                b.Draw(g);

                this.form1.AX1.Text = "( " + x + " , " + y + " , " + z + " )";

                this.form1.BX1.Text = "( " + x + " , " + y + " , " + (z + Length) + " )";

                this.form1.CX1.Text = "( " + x + " , " + (y + Length) + " , " + z + " )";

                this.form1.DX1.Text = "( " + x + " , " + (y + Length) + " , " + (z + Length) + " )";

                this.form1.EX1.Text = "( " + (x + Length) + " , " + y + " , " + z + " )";

                this.form1.FX1.Text = "( " + (x + Length) + " , " + (y + Length) + " , " + z + " )";

                this.form1.HX1.Text = "( " + (x + Length) + " , " + y + " , " + (z + Length) + " )";

                this.form1.JX1.Text = "( " + (x + Length) + " , " + (y + Length) + " , " + (z + Length) + " )";
            }
            else if (chedo == 4)
            {
                Pyramid p = new Pyramid(Height1 * 5, Length * 5, x * 5, y * 5, z * 5);
                p.Draw(g);

                this.form1.AX1.Text = "( " + x + " , " + y + " , " + (z + Length) + " )";

                this.form1.BX1.Text = "( " + (x + Length) + " , " + (y - Length) + " , " + (z) + " )";

                this.form1.CX1.Text = "( " + (x - Length) + " , " + (y - Length) + " , " + (z) + " )";

                this.form1.DX1.Text = "( " + (x - Length) + " , " + (y + Length) + " , " + (z) + " )";

                this.form1.EX1.Text = "( " + (x + Length) + " , " + (y + Length) + " , " + (z) + " )";

                this.form1.FX1.Text = "-";

                this.form1.HX1.Text = "-";

                this.form1.JX1.Text = "-";
            }
            else if (chedo == 5)
            {
                Globe p = new Globe(Length * 5, x * 5, y * 5, z * 5);
                p.Draw(g);

                this.form1.AX1.Text = "( " + x + " , " + y + " , " + z + " )";

                this.form1.BX1.Text = "-";

                this.form1.CX1.Text = "-";

                this.form1.DX1.Text = "-";

                this.form1.EX1.Text = "-";

                this.form1.FX1.Text = "-";

                this.form1.HX1.Text = "-";

                this.form1.JX1.Text = "-";
            }
        }