Page 1 of 1

Cube / 3D-Object

Posted: Tue Aug 10, 2004 1:47 pm
by 8122896
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 _/_/_/

Posted: Tue Aug 10, 2004 2:18 pm
by Marjan
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.

... Source Code ;-)

Posted: Tue Aug 10, 2004 4:57 pm
by 8122896
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

Posted: Wed Aug 11, 2004 9:08 am
by Marjan
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.