Example #1
0
        public MeshPlotter()
        {
            InitializeComponent();
            this.BackColor = Color.White;

            m_plotterView = new PlotterView(this);

            sr = new Surface3DRenderer(
                m_plotterView.ObservatorX, m_plotterView.ObservatorY,
                m_plotterView.ObservatorZ, m_plotterView.ScreenX, m_plotterView.ScreenY,
                ClientRectangle.Width, ClientRectangle.Height, 0.5, 0, 0);

            sr.ColorSchema = new ColorSchema(10);

            //sr.SetFunction("sin(x1)*cos(x2)/(sqrt(sqrt(x1*x1+x2*x2))+1)*10");
            this.OnResize(EventArgs.Empty);
            ResizeRedraw   = true;
            DoubleBuffered = true;
        }
        public Plot3DMainForm()
        {
            InitializeComponent();
            sr             = new Surface3DRenderer(10, 10, 5, 0, 0, ClientRectangle.Width, ClientRectangle.Height, 0.5, 0, 0);
            sr.ColorSchema = new ColorSchema(tbHue.Value);

            double[,] mesh = new double[30, 30];

            for (int x = 0; x < mesh.GetLength(0); x++)
            {
                for (int y = 0; y < mesh.GetLength(1); y++)
                {
                    mesh[x, y] = Math.Sin(x);
                }
            }

            sr.SetMesh(mesh);

            //sr.SetFunction("sin(x1)*cos(x2)/(sqrt(sqrt(x1*x1+x2*x2))+1)*10");
            Form1_Resize(null, null);
            ResizeRedraw   = true;
            DoubleBuffered = true;
        }