Ejemplo n.º 1
0
        private void createFigure(int figureType)
        {
            clearScenes();
            figure = new Polyhedron();
            switch (figureType)
            {
            case 0:
                figure.make_hexahedron();
                break;

            case 1:
                figure.make_tetrahedron();
                break;

            case 2:
                figure.make_octahedron();
                break;

            case 3:
                figure.make_dodecahedron();
                break;

            case 4:
                figure.make_icosahedron();
                break;
            }
            CameraMode oldMode = camera == null ? CameraMode.Simple : camera.mode;

            camera = new Camera(new Polyhedron(figure), pictureBox3, fill_color, light_x, light_y, light_z);
            camera.setMode(oldMode);
            camera.Apply(Transformation.Identity());
            figure.show(g, pr);
            camera.show(camera_g, old_fig);
        }
Ejemplo n.º 2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                //Tetrahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.make_tetrahedron();
                figure.show(g, projection);
                break;

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

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

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

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

            default:
                break;
            }
        }