Page 1 of 1

Problems with drawing openGL 3D charts

Posted: Thu Nov 30, 2006 2:18 pm
by 9641771
I'm drawing openGL 3D chart with the following code:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Bitmap bmp = tChart1.Bitmap;
            for (double x = 10.765; x < 51.534; x +=10)
                for (double z = 10.765; z <51.534; z +=10)
                    surface1.Add(x, x + z, z);
        }
    }
}
While running the appication I've got this exeption

Image
If I use x++ and z++ instead of x+=10 and z+=10 the code works fine.
Is this a feature or a bug?Maybe I should use some tricks?

Thank you.

Posted: Thu Nov 30, 2006 3:37 pm
by narcis
Hi bairog,

Have you tried setting the surface to IrregularGrid?

Code: Select all

            surface1.IrregularGrid = true;
You need to do this when x an z values are not equidistant and their increment is greater than 1.

Posted: Tue Dec 05, 2006 1:14 pm
by 9641771
I followed your advice. Thank you.