> At 18:28 15.08.00 , you wrote:
> >I had already made the upper arm segment and lower arm segment as
separate
> >classes.
> >However I derived them from BranchGroup.
>
> If you'll be needing several of these arms, then making them into classes
> may be
> a good way to go. It's also possible to create graphical objects
> procedurally by
> instantiating some of the base classes provided by Java3D and combining
and/or
> modifying them.
>
> I believe, though, that TransformGroup would be a better base class for
> your arm
> segments. If it's a BranchGroup, you'll still need to add a TransformGroup
> above
> or below the arm part so that it can be moved; and a TransformGroup will
> let you
> add other parts (i.e. the lower arm to the upper arm) just like a
BranchGroup
> will, with a smaller total number of objects.

I use composite links to build my kinematic chains.  To build the Link
class, I extended BranchGroup, gave it a BranchGroup member to represent the
far end and a TransformGroup member to connect the two.  Shapes can get hung
onto <CODE>this</CODE>. Then the chain gets built by instancing the links
with the geometries I want and connecting them with TransformGroups, one for
each joint.  I give the Link class a getFarEnd() method to get a reference
to the private BranchGroup.

This makes my assembly code looks something like

...
TransfGrpJoint1.addChild(Link1);
Link1.getFarEnd().addChild(TransfGrpJoint2);
TransfGrpJoint2.addChild(Link2);
Link2.getFarEnd().addChild(TransfGrpJoint3);
...

Remember to set the capability bits on the Link internals if you want to
read positions or try to pick things.

This construct uses three Groups, and it may be a little extravagant, but it
evolved in response to compiler errors that might have been complaining
about something else entirely.  Maybe some day, I'll see how much I can pare
it down, but, for now, I'm making very short chains so it doesn't matter
much..

Cheers,

Fred Klingener
Brock Engineering

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