understanding branchgroup and transformgroup

I’ve been playing with Xith3D off and on for several months now and I’m trying to get my mind around how the BranchGroup and TransformGroup are best used.

So as I understand it you make a universe and add a locale and a scene (branchgroup), one of each right? Now if I have several Shape3d’s to add at different translations and rotations, do I need to create two new TransformGroup’s (one for translation one for rotation) for every shape? Or am I supposed to just keep using the original objTranslate and objRotate and “reset” them after drawing each shape?

Hopefully I am making some sense here, its possible I’m just entirely confused and no one will understand me.

[quote]Now if I have several Shape3d’s to add at different translations and rotations, do I need to create two new TransformGroup’s (one for translation one for rotation) for every shape?
[/quote]
yep, that’s the usual way to go

since xith3d’s api is nearly fully compatible with java3d, i’ll recommend the following with covers all the important concepts:
Java 3D API Tutorial http://java.sun.com/products/java-media/3D/collateral/index.html#tutorial

hope that helps…

holger

Wow, very helpful. thanks!

A couple more questions:

  1. On that Java3D site they talk about Text2D… is there a similar feature for Xith3D?

  2. Is there a geometry feature to draw a cylinder?

thanks!

have a look at the toolkit package:

https://xith-tk.dev.java.net/servlets/ProjectDocumentList

there should be a text2d class as well as a geometry package

The geometry package is now bundled with Xith3D builds, and one was released today.

Download here:
http://xith.org/download/builds/latest/

When you decompress it, you will see a jar xith-tk.jar in the libs folder – this contains the geometry classes.

Javadocs for the cylinder class are here:
http://xith.org/javadoc/org/xith3d/geometry/Cylinder.html

Cheers,

Will.