Multiple objects can be loaded sequencially and by user choice by
-- deleting the old object from the scenegraph ( if that is your intent )
-- adding the new object to a node in the scenegraph
and this functionality is demonstrated by free demos with free sourcecode
including Sun's Java3d FlyThrough & Java3d Scenegraph Editor ( see below )
and I've done the add / remove trick for my Java3d Chess Player
where adding and deleting of the moved objects is required to move
the chess piece from the "chess board domain" to the "hand graping domain"
so when the hand holding the lifted piece rotates & translates, the
object grabbed remains "inhand" and properly moved.
A common error is not setting the permissions in the nodes properly
to allow for the action you require: read, add, delete, pick, or whatever.
Sun's Java3d FlyThrough Demo & Java3d Scenegraph Editor
-------------------------------------------------------
allow you to load mutiple 3d files (sequencially) including VRML
files with the Sun VRML Loaders at run-time
-- and the Java Source Code is free --- ( see below )
First, try a Web Demo of the "Appearance Explorer" :
"Appearance Explorer" Java3d Web Applet, Loads multiple ".obj"
-------------------------------------------------------------
http://web3dbooks.com/java3d/jumpstart/AppearanceExplorer.html- click on "Data"
- click on "Obj File: Galleon" -- or -- "Obj File: Beethoven"
- rinse, rather, repeat.
|
http://web3dbooks.com/java3d/jumpstart/Java3DExplorer.html |
http://web3dbooks.com/java3d/jumpstart/J3DJumpStart.zip |
| ^-- free source code
|
http://www.frontiernet.net/~imaging/games_with_java3d.html
|
| TransformGroup objTrans = new TransformGroup();
| objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
| objScale.addChild(objTrans);
|
| BranchGroup b = new objLoad("cig.obj");
| objTrans.addChild(b);
|
| ******************************
|
| if i want to change a file, do i have to
|
| "objTrans.Remove(b); and I
| objTrans.addChild(c); (c-- the other )
|
| but i fail.
|
| can you help me
|
| Thanks in advance
|
| Sun's Java3d Scenegraph Editor showing a Nasa VRML model
| --------------------------------------------------------
|
| uses the Sun VRML Loaders, source code available and is free.
|
| [ at this url: ]
|
|
http://java3d.netbeans.org/j3deditor_intro.html |
http://www.frontiernet.net/~imaging/terrain_rendering.htmlSelman wrote a Java3d book that was well received
and has a Swingtest.java applet and application that
allows you to load objects dynamically,
ie. "change" the viewed object when it is running by
allowing the user to select "sphere" or "cube" from
menu lists ( in this case it's not just displaying
Jav3d primative objects, but it has the core functionality
of deleteing and adding nodes in the scene graph that you
are seeking, and at that point the rest is left as
exercise to the student. The ObjLoad.java in Sun's Demos
directory has the code to load ".obj" files, so you have
all the tools you need.
| Picking of VRML objects with your mouse is demonstrated
| in a new book, Java 3D Programming, by Daniel Selman
| ( shown on the left ).
|
| The source code is avaible for free.
|
| [ here: ]
|
http://www.manning.com/selman/selman_source.zip| This new book uses the old, reliable Sun VRML Loaders for Java3d.
|
| The program reads a 3d scene as a simple VRML text file,
| and displays the Java3d Scene Graph ( which is interactive,
| you can expand and collapse the branches of the scenegraph
| and examine the contents of the nodes ), it renders the
| 3d scene, and when you click on an object it tells you
| what you clicked on.
|
| You can see ( and download ) the Java Source code of
| the operative file: VrmlPickingTest.java
|
| The publisher's site has more informatation on the book.
|
http://www.frontiernet.net/~imaging/games_with_java3d.html |
http://www.frontiernet.net/~imaging/sourcecode/VrmlPickingTest.java The Prentice-Hall books by Aaron Walsh are false & fraudulent
in their claims to present the most current methods, as a part
of the "Couch-Beiter Flame War" and fraud involving Sandy Ressler
at the NIST. Prentice-Hall, Yumetech.com and Aaron Walsh have
misrepresented and disparaged the old & reliable Sun VRML Loaders
in favor of the "new" Yumetech.com Loader, and the web demo above
__ DOES NOT __ load Web3d.org's __ VRML __ files, only the less
capable ".obj" files ... so the "Web3d" series of books from Prentice-Hall
does not show the loading of ___ Web3d.org 's ___ VRML __ files
because Sun's VRML Loaders were the best ones, and the Yumetech.com
folks didn't want anyone using those, and started the
"Couch-Beitler FlameWar" to disparage, falsely & fraudulently
misrepresent the facts and knowingly published false and misleading
"disinformation" in the unreliable Prentice-Hall / Pearson Ed books,
harming our community.
The Sun VRML Loaders are used by __ Nasa, __
the NSF supported Virtual Chemistry Lab ( "Lab3d" ),
me, and others simply choosing the "what works best",
and by people using Sun's Java3d FlyThrough & Java Scenegraph Editor,
and people interested in helping the Deaf Children by making
Java3d display NSF Developed Finger Spelling for the Deaf in a browser
with the Sun VRML Loaders
The "Couch-Beitler Flame War" was discussed recently here:
Java3d / Loaders: FullSail OpenFlight, Sun's VRML Loader, Yumetech.com flame war & loader
------------------------------------------------------------------------------------------------
http://www.java-gaming.org/cgi-bin/JGOForums/YaBB.cgi?board=3D;action=display;num=1053633092 ( reply #6 )---^
The original Vrml97Player.java file that came with
Sun VRML Loaders also implemented the functionality
of loading mulitiple files ( sequentically during one run )
and I have worked with that and similar things with
the Shout3d.com engine and my own 3d Java engines.
-- Paul, Java Developer & Web Animator
--------------------------------------
Imaging the Imagined: Modeling with Math & a Keyboard