Hi Marc,
I'm no expert on interaction, in fact I'm no expert at anything, but I HAVE
managed to make my 3D world change from Swing controls external to the
3D scene.
The key thing to know is that compiling a scene optimizes it, based on the
assumption that nothing will change unless you explicity declare it as
changeable. You do this declaration by setting so-called capability bits.
I'll assume you're using objects of type Box to represent your graph bars.
These are created with a fixed size and don't have any methods to change
any of the dimensions.
Fortunately, a change in size in (say) the Y dimension can be accomplished
without actually changing the Box object itself. The way to do this is to
connect the Box into the scene graph via a TransformGroup. Transforms can
be used not only to rotate and translate an object but also to stretch it.
Make the
object's height a standard unit (say, 1) when you create it and then stretch
its Y size using the Transform in the TransformGroup.
In order to be able to change the Transform, you need to
setCapability(ALLOW_TRANSFORM_WRITE) on the TransformGroup.
Your standard Transform3D is an identity matrix, which doesn't change the
look or position of what's attached to it. You can use setNonUniformScale()
on it to make the transform that stretch X, Y or Z by any factor you like. I
think you will want to set the factors to 1 for any dimension you DON'T want
to stretch.
I don't think you can get at the Transform3D "inside" the TransformGroup to
change it; what you need to do is create a new Transform3D for each size
change, adjust the scale factors with setNonUniformScale and setTransform()
on the TransformGroup to set up the new transformation.
If all this does not make sense yet, let me know and I'll try to cook you up a
code example.
At 04:25 31.07.00 -0400, you wrote:
>Hi,
>I have created a graph using Java 3d and i have placed it in a swing frame. I
>am trying to interact with the graph using the swing buttons. My problem is
>that once i have compiled and made the graph live (which needs to be done to
>show the graph) I cannot change any properties eg adding animation or
>changing the dimensions of the bars on the graph.(for example if i have two
>sets of data i want a swing button that can choose which set is displayed)
>does anyone know how i can change the graphs attributes once it is live ( i
>was thinking of some sort of customised picking behavior but i am not sure)
>
>Cheers
>Marc
===========================================================================
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".