void createJava3dObject(int loadBehaviors) {
	Matrix4d mat = new Matrix4d();
	mat.setIdentity();
	// Set the node's transform matrix according to the first frame
	// of the object's motion
	LwsFrame firstFrame = motion.getFirstFrame();
	firstFrame.setMatrix(mat);
	debugOutputLn(VALUES, "Light transform = " + mat);
	Transform3D t1 = new Transform3D();
	t1.set(mat);
	objectTransform = new TransformGroup(t1);
	objectTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
	Vector3f defaultDir = new Vector3f(0f, 0f, -1f);
	Point3f defaultPos = new Point3f(0f, 0f, 0f);

	switch (type) {
	case DIRECTIONAL:
	    light = new DirectionalLight(color, defaultDir);
	    break;
	case POINT:
	    light = new PointLight(color, defaultPos, attenuation);
	    break;
	case SPOT:
	    // Note: spotConeAngle in lw3d is half that of Java3d...
	    light = new SpotLight(color, defaultPos, attenuation, defaultDir,
				  2 * spotConeAngle, 0.0f);
	    break;
	default:
	    // Shouldn't get here
	    break;
	}

	light.setCapability(Light.ALLOW_COLOR_WRITE);
	if (light != null)  {
	  lwLight.setLight(light);
	  BoundingSphere bounds =
		    new BoundingSphere(new Point3d(0.0,0.0,0.0), 100000.0);
	  light.setInfluencingBounds(bounds);
	  objectTransform.addChild(light);

	  // load behaviors if we have to
	  objectBehavior = new Vector();
	  if (loadBehaviors != 0) {
	    Behavior b;
	    b = null;
	    motion.createJava3dBehaviors(objectTransform);
	    b = motion.getBehaviors();
	    if (b != null)
	      objectBehavior.addElement(b);

	    if (intensityEnvelope != null) {
	      b = null;
	      intensityEnvelope.createJava3dBehaviors(lwLight);
	      b = intensityEnvelope.getBehaviors();
	      if (b != null)
		objectBehavior.addElement(b);
	    }
	  }
	}
    }