SpanglefishDMS Consulting | sitemap | log in

Joining the Joints


Java3D is quite a basic 3D package. It has routines to construct 3D objects such as TriangleFanArray, it has routines to connect these objects together such as BranchGroup and it has routines to rotate and position the objects such as Transform3D. What Java3D lacks is the high level routines that make these routines easier to use.
This is why I found it necessary to write a package of routines to construct 3D shapes such as cones, cuboids and spheres. Then there are additional routines to colour and texture these shapes and to rotate and position them into more complex shapes such as an arm.
The rotate and position routine is a one time operation during construction, I now needed a run time routine to allow me to animate the parts.


The solution was a routine called Joint. The routine is basically a BranchGroup with two TransformGroups. The first TransformGroup is the child of the BranchGroup, the second a child of the first. The constructor of the Joint has a rotation and position of the Joint.
To assemble the robot, the first joint is used to rotate and position the robot. The body is a child of this joint's second TransformGroup. Joints are then added (children) to the body joint at the appropiate position for the neck, shoulders and hips. A lot of the body joints require two Joints to give them the appropiate movement - neck, shoulder and hips.

As you can see from the diagram. If, say, the left hip joint is rotated, every thing that is attached to the left hip is also rotated.
The next task was Animating the Joints.



WikanikoWork from Home