The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » Java 3D

Thread: World managment, Octree, setUsedData() etc...

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 5 - Last Post: Nov 4, 2009 7:55 AM by: weiland Threads: [ Previous | Next ]
polski

Posts: 12
World managment, Octree, setUsedData() etc...
Posted: Nov 2, 2009 5:34 AM
  Click to reply to this thread Reply

I have a question about world management.

I have considering implementing an OctTree or some kind of tree like structure for 3D.

Does java3d internally sort the coordinates (x,y,z) in the BranchGraph?
That is, does it balance the BranchGraph somehow?

I could pass data into each node via the setUserData() but I am not to keen
on that idea.

Any advice or tips I would appreciate.

Regards

tmilard

Posts: 195
Re: World managment, Octree, setUsedData() etc...
Posted: Nov 3, 2009 2:27 AM   in response to: polski
  Click to reply to this thread Reply

> I have a question about world management.
> I have considering implementing an OctTree or some
> kind of tree like structure for 3D.
>
> Does java3d internally sort the coordinates (x,y,z)
> in the BranchGraph?
> That is, does it balance the BranchGraph somehow?

Hello polski, I do nit come from Math and 3D games but your question does interest me.

I googled a bit and I found this :
See : ((3.3 Scene Graph Superstructure Objects ))
http://java.sun.com/javase/technologies/desktop/java3d/forDevelopers/J3D_1_2_API/j3dguide/VirtualUniverse.doc.html#47507

Maybe it won't help. Maybe it will.... it did help me to understand the basic concepts)
Thierry

polski

Posts: 12
Re: World managment, Octree, setUsedData() etc...
Posted: Nov 3, 2009 6:18 AM   in response to: tmilard
  Click to reply to this thread Reply

Thanks,

I am a little from both worlds. I am making scientific application.
The internals of Java3d (the tree like structure) must have
some form of balancing. I would see an OctTree/KdTree most fit.

I think I will have to look at the java3d source :(

Message was edited by: polski

weiland

Posts: 117
Re: World managment, Octree, setUsedData() etc...
Posted: Nov 3, 2009 7:23 AM   in response to: polski
  Click to reply to this thread Reply

Polski,

The scene graph as seen by the developer is only as balanced as you make it; typically, the graph doesn't go very deep, but the structure of the tree is controlled by TransformGroups and BranchGroups used as attachment points for objects that have been loaded or created by code.

There is a runtime "compiled" version of the scene, but I believe that will only have been flattened to the extent that immutable transforms and branches are embedded in it.

Could you elaborate a bit on what you're hoping to achieve? Are you looking for dynamic loading or level of detail management? There is some support for the latter; the former is pretty much custom coding.

If you can tell us more about your app that would help.

Bill

polski

Posts: 12
Re: World managment, Octree, setUsedData() etc...
Posted: Nov 3, 2009 8:11 AM   in response to: weiland
  Click to reply to this thread Reply

Hi weiland,

Well I want a container (tree) basically.

I am planing of implementing an OctTree,
so that I can do nearest neighbor searches by traversing the tree.

Think of a cloud of nodes. The user picks one and a "depth" and
an OctTree traversal is done and I can calculate euclidean distance from
the picked node to all surrounding ones of a given depth.

An OctTree would be ideal for this, and also would be beneficial in the future.

What I am wondering if I can use the already "tree like" structure (BranchGroup) of the Java3d pipeline. So I will not have to code the OctTree standalone.

I was thinking the Bounds classes could be very useful for this?

Regards

weiland

Posts: 117
Re: World managment, Octree, setUsedData() etc...
Posted: Nov 4, 2009 7:55 AM   in response to: polski
  Click to reply to this thread Reply

Seems like you could; something like OctTreeNode extends BranchGroup. You could embed Switch nodes to control child visibility if you're trying to achieve LOD.

Bill




 XML java.net RSS