Cube / 3D-Object

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
paramind
Newbie
Newbie
Posts: 2
Joined: Tue Nov 25, 2003 5:00 am

Cube / 3D-Object

Post by paramind » Tue Aug 10, 2004 1:47 pm

Hello.

Is there a way to add Cubes to a Serie? - the way one can draw cubes on the canvas? [e.g. Graphics.Cube(10,2,3)]
My goal is to create a serie that holds the logical data used to construct a 3D-object for later math operations like "is the clicked point within one of the drawn cubes?"
I'm not talking about the math behind such operations, just about establishing a relationship between the objects held by the serie and math logic. Unfortunately Graphics.Cube is void ...

Any suggestions, any help?

Thanks in advance,

_/_/_/ paramind _/_/_/

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Aug 10, 2004 2:18 pm

Hi.

I'd create a new series type which would draw cubes and return clicked cube index.

a) First thing to do is decide how you'd define cube. I guess x,y,z and xlength, ylength and zlength should cover all possibilities. To add a "cube" to series, you'd override series Add method and define it as overload with 6 different (float) parameters.

b) Next thing to do is define actual drawing algorithm. You can use values from Add (x,z,y, xlength, ylength, zlength) together with Graphics3D.Cube method to actually draw a cube on chart canvas.

c) Finally, you'll have to code the series Clicked method. In this method you'll transform current clicked 2D position to real 3d position and based on this information, retrieve clicked cube index (this is the hardest part).

To do the above you'll need TeeChart .NET sources as good reference and starting point on how to build/code a series in TeeChart.
Marjan Slatinek,
http://www.steema.com

paramind
Newbie
Newbie
Posts: 2
Joined: Tue Nov 25, 2003 5:00 am

... Source Code ;-)

Post by paramind » Tue Aug 10, 2004 4:57 pm

Hello Marjan,

thanks for the quick reply! I was afraid, you'd come up with this strategy - because I have NO source code ;-). I don't really want to buy the source code, since I'm using T-Chart for quite a while and this is the only thing, I can't cover with the standard features.

I simply need an egg, not a hen ;-)

So ... ;-) Is there any chance, to get a documentation/sample code or a template? This would be great!

Greetings, paramind

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Aug 11, 2004 9:08 am

Hi.

Yes, I could send you small example how to derive new series type. Please contact me directly at "marjan at steema dot com" and I'll send you the example to your email address.
Marjan Slatinek,
http://www.steema.com

Post Reply