As far as the hierarchy is concerned, here is what I suggest:
Suppose you have three parts, top, middle, and bottom of the arm (bottom is
like the hand). Then:
//initialize the bottom transform group and construct the shape
TransformGroup bottomGroup=new TransformGroup();
bottomGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
//etc, etc...//
ColorCube bottom=new ColorCube(0.001);
bottomGroup.addChild(bottom);
//do the same for the middle, but add the bottomGroup as a child also
TransformGroup middleGroup=new TransformGroup();
middleGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
//...//
ColorCube middle=new ColorCube(0.01);
middleGroup.addChild(middle);
middleGroup.addChild(bottomGroup);
//same for the top, but with middleGroup as its child
TransformGroup topGroup=new TransformGroup();
topGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
//...//
ColorCube top=new ColorCube(0.1);
topGroup.addChild(top);
topGroup.addChild(middleGroup);
/* you can continue in a similar way for as many arm-parts as you want.
finally you need to initialize the branchgroup, set the capabilities (if
necessary), and add the top most transformGroup as its child
*/
BranchGroup arm = new BranchGroup();
BranchGroup.setCapability( ... );
//...//
arm.addChild(topGroup);
This should take care of the hierarchy (I hope I haven't done any mistakes
- I claim no experties:-)). Now, if you want to rotate the top and
everything below it, apply the rotation to the Transform3D of the topGroup.
If you want to rotate the middle and everything below it, use the
transform3D of the middleGroup, etc.
The only thing left is you should make sure that your rotations are
correct. I didn't take a look at how you set up the axis or how you find
the "joint" around which each object is to be translated...
Good luck,
Paris
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
===========================================================================
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".