Hello Marc,

At 17:53 23.08.00 , you wrote:
>Does anyone have any ideas on how a pie chart could be created in Java 3D
>Any ideas are welcomed
>Many thanks for any help you may give
>
>Cheers
>Marc

I have an idea, but that's all it is - I don't have the experience to know
if it's a good idea or if it will work.

A pie chart is either no pie (super trivial case), a whole pie (trivial
case) or two or more pie segments.

I'll leave the super trivial case to you :)

The trivial case is a whole pie. This can be represented by a
com.sun.j3d.utils.geometry.Cylinder(30, 1)  (for example).

The nontrivial case is part of such a cylinder. While there is no
constructive geometry in Java3D, there is clipping. The class for this is
javax.media.j3d.ModelClip.

If I understand the documentation right, a ModelClip consists of 6 planes,
hopefully somehow intersecting, between which you squash some object, such
as your cylinder. ModelClip is a Leaf node, so you hang it somewhere into
your scene branch graph. The object(s) to be squashed must be contained in
a Group, and that Group is hooked into a list of things to squash with the
clip.

If the mutual angles are chosen just right, the only visible part of your
cylinder will be the segment you wanted to show. If you can do this with 1
segment, you can do it with any number, thus solving the non-trivial case.
Remember that you'll need to build a bogus Group for each segment, and a
ModelClip to shear it. But then you'll probably need TransformGroups
anyway, to orient the cylinder the way you want.

I can't help you with how to set up the planes. 3D math hurts my head.

Please let me know if this works - I'm as curious as you.

Hope this helped,

-Carl-

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to