Page 1 of 1

Problem on adding XYZ poins in 3D surface wireframe chart

Posted: Thu May 28, 2009 1:34 pm
by 5891785
Teechart pro v5 VCL
BCB6

Hi,

Y would like to draw a cylinder with several steps depth.
Using surface wireframe and AddXYZ method.
The first 180 ° ar ok
but while drawing the remainder, points are not joined correctly.
(irregular is checked)

Here is a trivial sample of code

Code: Select all

      for(int i = 0; i < 360; i ++)
      {
         float angle = DegToRad(i);
         x = cos(angle);
         y = sin(angle);
         Series1->AddXYZ(x, y, 0);
         Series1->AddXYZ(x, y, 1);
      }
Thanks a lot for your help...

Posted: Thu May 28, 2009 2:13 pm
by yeray
Hi psau,

First, the problem is that you are trying to draw an irregular surface and that's why only a few points are drawn.
To see a "better" result you could do this:

Code: Select all

Series1.IrregularGrid := true;
But these series aren't thought to draw things like that so the result isn't the expected. On the other hand, maybe you could try using a Point3D series with invisible pointer so that only the line will be drawn. But now you will see that the lines are drawn doing a "zigzag" so here you should adjust your adding loop to draw lines as you want.