Hi Katja,

I think you may be making things harder than they are. A Java3D loader class (e.g., 
Xj3D) will load a graphics file (e.g., VRML97) into a Java3D scene in memory. It does 
not write a separate file. So, the loader will return a BranchGroup object  which you 
can attach to your master scenegraph. For example, you could attach it to the 
ViewPlatform, or a BranchGroup under the Viewplatform. 

If you do it this way, you can follow Georg's advice without EVER recompiling. You add 
the switch nodes with the spheres as another branch on your scenegraph. You never have 
to export the scenegraph to a file or recompile.

I'm sure there are some examples of loading in 3D files and viewing them on the Java3D 
and j3d.org site.

josh

>>> [EMAIL PROTECTED] 07/31/02 03:32PM >>>
Hi Georg,

Sorry to bug you again about such a simple question. I am a Java3D beginner
and don't know all the possibilities that Java3D offers.

The purpose of my program is to take any virtual world, open it with my
application, and allow the user to click on several points.  After these points
are chosen, I want to show a "fly-through" hitting all of the points the user
has chosen.  To do this, I first open the virtual world (without a loader or
scene graph io), edit (with FileReader and FileWriter), and recompile with a
picking plane.  Are you suggesting that I add in 50 or so spheres switched
off, and as the user clicks, transform them to the coordinates they selected
and turn it on?  This would still require me to recompile the entire virtual
world file (by my application) with the picking plane and the spheres.  At this
point, I would recompile the same virtual world again (2nd time) after I
removed the spheres, picking plane, and added in the coordinates and transforms
for my fly-through.

If so, could you please point me in the right direction for adding in these
spheres with switches, turning them on/off and transforming them (after I
added them)?

I am also confused about "loaders".  I thought loaders were designed to take
another type of file and convert them into java 3d files.  Is it possible to
import a java3d scenegraph from another file, change the scenegraph and
display it in a new window without recompiling the file? If so, please explain
the rough outline. What is the scene graph io that you mentioned? I found a
class called SceneGraphIO in the J3dFlyThrough package, but I think that it only
loads .j3f-files.

Thank you very much for your help!!!!

Katja

> Dear Katja,
>
> > My problem is that I want the user to be able to open ANY j3d file e.g.
> some
> > downloaded or self programed virtual world. That means there is no
> switch
> > group in that file. All functionality has to build into my application
> (main
> > window). Unfortunately I can't come up with anything but recompilation
> (I don't
> > like that either) after I put in the spheres. Is there any other way? Is
> > there any possibility of changing parts of the scenegraph without
> recompilation
> > from the main application?
>
> I'm not 100% sure if I really understand, what you want to do,
> but I interpret: after loading (via some loader or via scene
> graph io) you have a scene graph to show, you are able to add
> a sphere to your overall scene graph and by recompilation you mean
> BranchGroup.compile(). If so, it still would make sense to only
> once add the proposed switch with enough tgs/spheres. That avoids
> frequent restructuring of the scene graph on every pick/selection
> change.
>
> When you use a loader you get the scene graph via Scene.getSceneGroup()
> and have to attach that to your locale anyway. So you could have:
>
> + locale
>   |
>   + bgRoot
>     |
>     + aSwitch
>     | |
>     | + tg1
>     | | |
>     | | + sphere1
>     | |
>     | + tg2
>     | | |
>     | | + sphere2
>     | .
>     |
>     + bgLoaded (as gotten by Scene.getSceneGroup())
>       |
>       .
>
> bgRoot has capabilities to allow child addition/removal, all
> down to bgLoaded is constructed on app startup and never changes
> again (except switching spheres on/off and tranforming them), on
> every load you de/attach bgLoaded.
>
> And if the problem were, that the BranchGroup gotten from
> Scene.getSceneGroup() has the capability ALLOW_DETACH not
> set (the loader docs seem to not enforce that) and that capability
> is not settable (because bgLoaded is compiled already), you could
> have:
>
>     | | |
>     | | + sphere2
>     | .
>     |
>     + bgDetachable
>       |
>       + bgLoaded (as gotten by Scene.getSceneGroup())
>         |
>         .
>
> where bgDetachable is created by you and has ALLOW_DETACH. Then
> you can, at load time, detach bgDetachable, get rid of the current
> bgLoaded (as bgDetachable now isn't live any more), add the new

> loaded scene to it and reattach bgDetachable.
>
> Does this make sense? Regards
>
> Georg
>  ___   ___
> | + | |__    Georg Rehfeld      Woltmanstr. 12     20097 Hamburg
> |_|_\ |___   [EMAIL PROTECTED]           +49 (40) 23 53 27 10
>
>
===========================================================================
> 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".
>

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net 

===========================================================================
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".

==========================================================================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