Page 1 of 1

TTriSurface with the hot palette

Posted: Wed Apr 20, 2005 1:27 pm
by 9340885
I've asked here some weeks ago but I have no answer, unfortunately.
I use the TTriSurface series. I set all the parameters during the design mode but add points in the run-time. In the design mode I see right surface with random points. This example shows me right hot palette (from yellow to red). But when I start my application with real points I see blue surface with one or two red triangles. I don't understand why it looks so.

How I can see real hot surface?

Please, answer me, it's really important for me

Posted: Wed Apr 20, 2005 1:33 pm
by narcis
Hi Alexey,
I've asked here some weeks ago but I have no answer,
unfortunately.
On 8th April I sent you an e-mail answering this question. I'm writting down my reply below:

It looks like a drawing bug. Workaround(s) : switch to opengl, as the used triangle hiding algorithm does not work in all cases.

Regarding the second question about surface at specific y coordinate:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var fp: TFourPoints;
    z0,z1: Integer;
begin
  // draw plane at y(x,z) = 0
  fp[0].X := Series1.GetHorizAxis.IStartPos;
  fp[0].Y := Series1.CalcYPosValue(0.0);;
  fp[1].X := Series1.GetHorizAxis.IEndPos;
  fp[1].Y := fp[0].Y;
  fp[2].X := fp[1].X;
  fp[2].Y := fp[0].Y;
  fp[3].X := fp[0].X;
  fp[3].Y := fp[0].Y;
  z0 := Chart1.Axes.Depth.IStartPos;
  z1 := Chart1.Axes.Depth.IEndPos;
  Chart1.Canvas.Brush.Color := clYellow;
  Chart1.Canvas.PlaneFour3D(fp,z0,z1);
end;

Alternatively, you can also use surface series with four points with the same (y=0) coordinate.

Posted: Thu Apr 21, 2005 10:02 am
by 9340885
Hi, Narcis!
narcis wrote:On 8th April I sent you an e-mail answering this question. I'm writting down my reply below:

It looks like a drawing bug. Workaround(s) : switch to opengl, as the used triangle hiding algorithm does not work in all cases.
I've received your e-mail, thank you. But in my previous post I wrote that OpenGL doesn't help, unfortunately, it adds another problems as you can see in the following picture: http://www.ljplus.ru/img/knari/tchart_bug2.GIF

Thank you for second reply, it should work. But the main problem for me is to have not blue, but hot surface now. With OpenGL or without it my surface is blue and I don't understand why is it. Because in the design mode it looks right.

Posted: Tue Apr 26, 2005 8:37 am
by narcis
Hi Alexey,

It's really hard to give you a solution without having a test application. So could you please send us an example we can run "as-is", together with data, so that we can reproduce the problem here?

You can post your examples at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Thanks in advance.

Posted: Mon Jun 13, 2005 1:55 pm
by 9340885
Hi, Narcis!
narcis wrote:Hi Alexey,

It's really hard to give you a solution without having a test application. So could you please send us an example we can run "as-is", together with data, so that we can reproduce the problem here?
I'm sorry for so long silence from my side. I had a problems with some other products and this task was not very important for a moment.

Now I work on it once more. I understand that it's difficult to understand why I have no hot chart. But it's a problem to send you an "as-is" example, because my application uses a lot of other our own packages. These packages are necessary both to compile and to run it.

I've tried to make simple test application but it uses hot palette. Mine - not.

Is there any cases when the library can switch the palette off? Maybe I've got one of such cases.

Posted: Mon Jun 13, 2005 2:18 pm
by 9340885
Hi, Narcis!
narcis wrote:Regarding the second question about surface at specific y coordinate:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var fp: TFourPoints;
    z0,z1: Integer;
begin
  // draw plane at y(x,z) = 0
  fp[0].X := Series1.GetHorizAxis.IStartPos;
  fp[0].Y := Series1.CalcYPosValue(0.0);;
  fp[1].X := Series1.GetHorizAxis.IEndPos;
  fp[1].Y := fp[0].Y;
  fp[2].X := fp[1].X;
  fp[2].Y := fp[0].Y;
  fp[3].X := fp[0].X;
  fp[3].Y := fp[0].Y;
  z0 := Chart1.Axes.Depth.IStartPos;
  z1 := Chart1.Axes.Depth.IEndPos;
  Chart1.Canvas.Brush.Color := clYellow;
  Chart1.Canvas.PlaneFour3D(fp,z0,z1);
end;

Alternatively, you can also use surface series with four points with the same (y=0) coordinate.
I've tried this example. It looks like the best decision but when I draw the flat surface in OnAfterDraw event this surface overdraws all series. It means this surface is in front of all other drawing. It doesn't cut the series on two part (above zero level and below it).

The same situation if I use another TTriSurface series with four points.