Beispiel #1
0
        //DRAW FIGURE
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                //Tetrahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Tetrahedron();
                figure.Show(g, projection);
                break;

            case 1:
                //Hexahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Hexahedron();
                figure.Show(g, projection);
                break;

            case 2:
                //Oktahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Octahedron();
                figure.Show(g, projection);
                break;

            case 3:
                //Icosahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Icosahedron();
                figure.Show(g, projection);
                break;

            case 4:
                //Dodecahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Dodecahedron();
                figure.Show(g, projection);
                break;

            default:
                break;
            }
        }
Beispiel #2
0
        //Рисование фигуры
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                //Татраэдр
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Tetrahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                break;

            case 1:
                //Гексаэдр
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Hexahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                break;

            case 2:
                //Октаэдр
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Octahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                break;

            case 3:
                //Икосаэдр
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Icosahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                break;

            case 4:
                //Додекаэдр
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Dodecahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                break;

            default:
                break;
            }
        }
Beispiel #3
0
        //DRAW FIGURE
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                //Tetrahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Tetrahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.Gouraud)
                {
                    show_gouraud();
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                else if (clipping == Clipping.Texture)
                {
                    show_texture();
                }
                break;

            case 1:
                //Hexahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Hexahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.Gouraud)
                {
                    show_gouraud();
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                else if (clipping == Clipping.Texture)
                {
                    show_texture();
                }
                break;

            case 2:
                //Oktahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Octahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.Gouraud)
                {
                    show_gouraud();
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                else if (clipping == Clipping.Texture)
                {
                    show_texture();
                }
                break;

            case 3:
                //Icosahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Icosahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.Gouraud)
                {
                    show_gouraud();
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                else if (clipping == Clipping.Texture)
                {
                    show_texture();
                }
                break;

            case 4:
                //Dodecahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.Dodecahedron();
                if (clipping == 0)
                {
                    figure.Show(g, projection);
                }
                else if (clipping == Clipping.Gouraud)
                {
                    show_gouraud();
                }
                else if (clipping == Clipping.ZBuffer)
                {
                    show_z_buff();
                }
                else if (clipping == Clipping.Texture)
                {
                    show_texture();
                }
                break;

            default:
                break;
            }
        }