Surface rotation

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
BorisVeeco
Newbie
Newbie
Posts: 3
Joined: Wed Jul 14, 2004 4:00 am
Location: NJ, USA
Contact:

Surface rotation

Post by BorisVeeco » Mon Jun 08, 2009 5:25 pm

Can anybody let me know, what property allow to rotate/tilt axes (along with grid and surface plot) using the mouse (as in "Surface speed" example for Tee Chart Pro 7)
Thank you
Boris

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Jun 09, 2009 7:41 am

Hi Boris,

There is the Rotate tool available to allow chart rotation by mouse dragging. You should find it at Tools/Add.../Other tab in the editor.

Also note that in the example you mentioned, there is a complete turn done by code using the rotation property:

Code: Select all

for t:=0 to 360 do
begin
  Chart1.View3DOptions.Rotation:=t;
  Chart1.Repaint;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

BorisVeeco
Newbie
Newbie
Posts: 3
Joined: Wed Jul 14, 2004 4:00 am
Location: NJ, USA
Contact:

Post by BorisVeeco » Tue Jun 09, 2009 7:19 pm

Yeray:
Great, it is working, thanks a lot. What can be done with BottomAxis->Title->Caption to follow the axis itself? Labels on axis are rotated properly, but not axis name.
Boris

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Jun 10, 2009 8:28 am

Hi Boris,

I'm not sure to understand how do you expect that to work. Can you reproduce it with the mentioned demo? Could you please explain the exact 3D parameters (elevation and rotation) I should set at the demo to reproduce it?

Thanks in advance
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

BorisVeeco
Newbie
Newbie
Posts: 3
Joined: Wed Jul 14, 2004 4:00 am
Location: NJ, USA
Contact:

Post by BorisVeeco » Wed Jun 10, 2009 7:50 pm

Yeray:
The example mentioned does not have any captions on horizontal / vertical axes. In my case axes keep name and units in use. Amaizing thing is that "vertical" caption behaves properly, while horizontal is following elevation, but not (bottom) axis direction. Looks like bottom caption is always in chart's front plane and always horizontally-oriented (regardless of axis direction). I'm not exactly sure, but there is a chance, that it was designed in such a way. If so, nothing can probably be done on this matter. Please let me know what you think about it.
And probably the very last question:
I need to show the cross-section of the surface with some plane. All what neccesary is to plot vertical plane, crossing some surface plot. I tried to plot the second seriessurface with 4 points loaded and it did not work out. Moreover, code occasionally crashed with access violation message on attempt to rotate.
Another option that I tried is not to plot vertical plane, but just show the intersection of this plane with original surface (plot the line in some direction, that follows surface shape). I plotted another surfaceseries as wireframe and expected to get the single wire line. Nothing show up on the screen.
Please let me know, what I could do wrong.
Also please keep in mind, that X-Z coordinates for both plane (or line) and original surface are never coinside.
Thanks a lot for all your help.
Sincerely
Boris

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Surface rotation

Post by Yeray » Fri Jun 12, 2009 3:17 pm

Hi Boris,

The easiest solution to do both things would be using TTeeOpenGL. I think that the following example shows more or less what you want:

Code: Select all

uses Series, Teesurfa, TeeTriSurface, TeeTools, TeeOpenGL;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with TTeeOpenGL.Create(self) do
  begin
    TeePanel := Chart1;
    Active := true;
  end;

  Chart1.Chart3DPercent := 100;
  Chart1.Aspect.Orthogonal := false;
  Chart1.Aspect.Zoom := 70;

  Chart1.AddSeries(TSurfaceSeries.Create(self));
  Chart1[0].FillSampleValues(25);

  Chart1.Tools.Add(TRotateTool.Create(self));

  Chart1.Axes.Bottom.Title.Caption := 'Bottom axis';
  Chart1.Axes.Left.Title.Caption := 'Left axis';

  Chart1.AddSeries(TTriSurfaceSeries.Create(self));

  with (Chart1[1] as TTriSurfaceSeries) do
  begin
    AddXYZ(3,-0.3,3);
    AddXYZ(20,-0.2,20);
    AddXYZ(5,1.5,5);
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply