Improvements/Changes on Scene/SceneBase

hi

After I’ve studied the Scene and SceneBase classes used by model loaders, I’ve come to the opinion that these ones need slight changes.

Why not letting SceneBase extend BranchGroup or even better TransformGroup? I’ve no idea why BranchGroup exists. In each and every situation a BranchGroup is used a TransformGroup would be as good or better. And if you want to do something senseful with the Scene, you will mostly have to put it into an (additional) TransformGroup.
The getBranchGroup() method would be marked depricated for compatiblity reasons and return the Scene itself. The setSceneGroup method wouldn’t make any sense to exist and could just be removed.

If SceneBase would extend TransformGroup, you could add a float parameter to the load method indicating the size (of the bounding sphere), so that the scene is scaled to that size.

Of course the loaders would need slight changes. But they wheren’t too big.

All these getFooBarNodes() methods should make use of generic java code (of course their private fields, too) and should not return arrays but genericaly typed Vectors and HashMaps. I don’t know, where’s the sense in pushing the items into arrays and returning these ones. Just return the generic and typesafe vectors.

With these changes, which don’t do any harm, the Scene/SceneBase would be of much more use, I think.

Xith needs to maintain compatibility with the Java 3D API. Otherwise the learning curve becomes too steep.

How many people actually come from java3d to xith3d? And don’t I think, letting SceneBase extend TransformGroup or BranchGroup changes this one too much so that java3d people won’t recognize it, do they?

I think if we drifted away from the Java 3D API I would want us to support another standardized scenegraph API such as a Java version of OpenSceneGraph:
http://openscenegraph.org/

Another possibility is to use COLLADA as a scenegraph API:
http://www.collada.org/

I want to avoid a non-standard custom API.

I do not agree…

How would you use Collada as a scenegraph API ? As a standardized format why not but it’s not a scenegraph API ???

If we would only reproduce another existing API, why are we doing it and not using the existing one? I think, we can do some things other than on the “original” if this way is better. Of course we shouldn’t drift too far away, so that it is not recognizable and as you say the learning curve was to steep. But these slight changes I suggested are really slight. They make the API better and better usable, more high-performance and very close to the so called standard.

Of course I understand your arguments, but as I say: If we don’t do senseful things better, we can just use the standard you are talking about.

I agree.