Page 1 of 1

Draw3D.Canvas Initialization

Posted: Thu Jun 22, 2006 9:55 am
by 8443014
Hello,

I am trying to make some 3D objects using the TDraw3D. When i draw an object it doesn't appear on the canvas. Probably because the actuall coordinates of the points of the object are pretty huge numbers and very far away from the current view of the canvas. I was wondering, is there any way to initialize the canvas and general bring it in a position that i can view this object? Thank you in advance.

King Regards
Dimitrios

Posted: Thu Jun 22, 2006 10:19 am
by narcis
Hi Dimitrios,

It may help you retrieving chart's rectangle coordinates using Draw3D1.ChartRect. It could also help having a look at the All Features\Components\Draw3D panel and All Features\Components\OpenGL\Football example in the TeeChart features demo. You'll find the demo at TeeChart's program group.

If the problem persists please send us an example we can run "as-is" to reproduce the problem here. You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Draw3D.Canvas Understanding

Posted: Thu Jun 22, 2006 2:39 pm
by 8443014
Hello Narcis

Thanks for the suggestions but it didn't make any difference. Could you please try the following scenarion and see if it works? In a new project add a TDraw3D and a TeeCommander components to the form. Then simply on the OnPaint Event of the TDraw3D try to draw on the canvas (e.g. Draw3D1.Canvas) a point with x:-4129749 and y:190627496. Can you view the point, what setup in terms of zooming or offesets do you have to do in order to accomplice that? Thanks you.

King Regards
Dimitrios
narcis wrote:Hi Dimitrios,

It may help you retrieving chart's rectangle coordinates using Draw3D1.ChartRect. It could also help having a look at the All Features\Components\Draw3D panel and All Features\Components\OpenGL\Football example in the TeeChart features demo. You'll find the demo at TeeChart's program group.

If the problem persists please send us an example we can run "as-is" to reproduce the problem here. You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Posted: Thu Jun 22, 2006 3:00 pm
by narcis
Hi Dimitrios,

I did:

Code: Select all

procedure TForm1.Draw3D1Paint(Sender: TObject; const ARect: TRect);
begin
  Draw3D1.Canvas.Sphere(-4129749,190627496,0,10);
  Draw3D1.Canvas.Sphere(100,100,0,10);
end;
And could only see the second sphere. The first sphere is far away from Draw3D1 bounds. The available surface will be limited for Draw3D1's width and height.

Posted: Thu Jun 22, 2006 3:57 pm
by 8443014
Hi NarcĂ­s

Ok thanks a lot, i think i'll have to modify my values to fit the canvas bounds. Thanks for your time.

King Regards
Dimitrios
narcis wrote:Hi Dimitrios,

I did:

Code: Select all

procedure TForm1.Draw3D1Paint(Sender: TObject; const ARect: TRect);
begin
  Draw3D1.Canvas.Sphere(-4129749,190627496,0,10);
  Draw3D1.Canvas.Sphere(100,100,0,10);
end;
And could only see the second sphere. The first sphere is far away from Draw3D1 bounds. The available surface will be limited for Draw3D1's width and height.