Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / November 2005

Tip: Looking for answers? Try searching our database.

Adding objects to a live scenegraph

Thread view: 
Craig D - 10 Nov 2005 02:36 GMT
Hi, Im trying to add objects into my scene on some kind of MouseEvent.
I want to click a certain point and have a cube for instance generated.
The java3d tutorial from sun goes through basically every possible
other use for every possibly event but doesnt seem to mention how you
add to the scenegraph in this way!!! Any help would be greatly
appreciated!
Paul Drallos - 10 Nov 2005 14:00 GMT
> Hi, Im trying to add objects into my scene on some kind of MouseEvent.
> I want to click a certain point and have a cube for instance generated.
> The java3d tutorial from sun goes through basically every possible
> other use for every possibly event but doesnt seem to mention how you
> add to the scenegraph in this way!!! Any help would be greatly
> appreciated!

The main thing you have to remember is that whatever it is you want to add to the live scenegraph, it has to be wrapped in a BranchGroup.  

The root branch of your scenegraph should have ALLOW_CHILDREN_WRITE capabilities.  It may also need ALLOW_CHILDREN_EXTEND.

Create your Shape3D object (or whatever it is) and make it a child of a BranchGroup.  Your PickMouseBehavior can then add the BranchGroup (contains the Shape3D object) to the root branch of your scenegraph.

Paul


Craig D - 12 Nov 2005 04:51 GMT
Hey Paul,
Thanks for the info. Should be exactly what im looking for. Will see
how far i get tomorrow and let you know if  i run into any other
problems!!

Thanks,
Craig


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.