Online Chapter on Articulated Models

Dear All,

I’ve just added an introductory chapter on building simple articulated models out of boxes and cylinders. The example model performs a basic form of collision detection and recovery.

It’s chapter N4 “The Colliding Grabbers” in the Java 3D section of the Killer Game Programming in Java website, http://fivedots.coe.psu.ac.th/~ad/jg/.

Comments are appreciated.

  • Andrew

I’m not sure if I’m understanding the code that performs rotations in 7.5:


// global reusable objects for calculations
private Transform3D t3d = new Transform3D();
private Transform3D toRot = new Transform3D();
private void doRotate(TransformGroup tg, int rotType, double angle)
// rotate the tg joint by angle radians
{
  tg.getTransform(t3d);
  if (rotType == X_JOINT)
    toRot.rotZ(angle); // left/right == rotation around z-axis
  else if (rotType == Y_JOINT)
    toRot.rotX(angle); // up/down == rotation around x-axis
  else // must be Z_JOINT
    toRot.rotY(angle); // spin == rotation around y-axis
  t3d.mul(toRot); // t3d = t3d * toRot, which adds the rotation
  tg.setTransform(t3d);
}

I don’t quite understand where “toRot” is getting it’s initial value from.

The Transform3D constructor initializes the transform to be an identity matrix, which you can think of as a rotation of 0 degrees for the x-, y-, and z- axes.

  • Andrew

You know what, I did know that. I have no idea why it didn’t make sense before…

Hello,Mr
your book is very good! In your book of “killer game programing in java” , you have Tour3D example,In this example
you use BoundingSphere as a sphere, I want to use BoundingBox , but can’t take effect, i think it is same as BoundingSphere.
can you help me
thank you!
best reguards!!!
sunnyan