Skip to main content

Dynamic J3D

2 replies [Last post]
Lavender81
Offline
Joined: 2006-02-17

I have a sphere on which lie 'n' tiny spheres. The big sphere has a rotation behaviour (stimulus:mouse drag). The tiny spheres are supposed to follow this rotation (being part of the big sphere). So the scene graph encompasses a SimpleUniverse object, to which a BG is attached, to which a TG, a rotation behavior and light are attached.On the other hand, the TG is attached to a big sphere and to other TG's which attach to the tiny spheres.

1.Simple Universe
1.1 BG
1.1.1 behaviour
1.1.2 Light
1.1.3 TG
1.1.3.1 big sphere
1.1.3.2 tg1
1.1.3.2.1 tinySphere1

1.1.3.3 tg2
1.1.3.3.1 tinySphere2

.
.
.

1.1.3.(n+1) tg_n
1.1.3.(n+1).1 tinySphere_n

Now, during runtime, n has changed to m. And creating the tiny TG's and adding them to the mother TG caused an error. Is there a solution to this ? If the tiny TG's where directly under a BG that would be an easy issue to address, but being under another TG, I can find no way of dynamically attaching these tiny spheres to the big sphere!

I'd appreciate any help !

-Lavender

|

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Lavender81
Offline
Joined: 2006-02-17

Thanks a bunch, Mike !

Mike Pilone

In your parent TG, add a BG with the capability to add children
(ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_WRITE). At runtime, create a new BG,
add your tiny TG to it, then attach this BG to the parent BG. As long as the
capabilities are set correctly you can add and remove BranchGroups at
runtime.

-mike

> -----Original Message-----
> From: java3d-interest@javadesktop.org [mailto:java3d-
> interest@javadesktop.org]
> Sent: Sunday, November 14, 2004 10:00 AM
> To: interest@java3d.dev.java.net
> Subject: [JAVA3D-INTEREST] Dynamic J3D
>
> I have a sphere on which lie 'n' tiny spheres. The big sphere has a
> rotation behaviour (stimulus:mouse drag). The tiny spheres are supposed to
> follow this rotation (being part of the big sphere). So the scene graph
> encompasses a SimpleUniverse object, to which a BG is attached, to which a
> TG, a rotation behavior and light are attached.On the other hand, the TG
> is attached to a big sphere and to other TG's which attach to the tiny
> spheres.
>
> 1.Simple Universe
> 1.1 BG
> 1.1.1 behaviour
> 1.1.2 Light
> 1.1.3 TG
> 1.1.3.1 big sphere
> 1.1.3.2 tg1
> 1.1.3.2.1 tinySphere1
>
> 1.1.3.3 tg2
> 1.1.3.3.1 tinySphere2
>
> .
> .
> .
>
> 1.1.3.(n+1) tg_n
> 1.1.3.(n+1).1 tinySphere_n
>
> Now, during runtime, n has changed to m. And creating the tiny TG's and
> adding them to the mother TG caused an error. Is there a solution to this
> ? If the tiny TG's where directly under a BG that would be an easy issue
> to address, but being under another TG, I can find no way of dynamically
> attaching these tiny spheres to the big sphere!
>
> I'd appreciate any help !
>
> -Lavender
>
>
>
> |
> ---
> [Message sent by forum member 'Lavender81' (Emilie)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=38236&#38236
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
> For additional commands, e-mail: interest-help@java3d.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net