matRoboticArm.setColor("Specular", new ColorRGBA(.7f, 1.0f, .7f, 1f));
matRoboticArm.setFloat("Shininess", 50); // [1,128] lower is shinier
// elongated box for arm sections
Box box = new Box(new Vector3f(0, 0, SECTION_LENGTH), SECTION_CROSS_DIM, SECTION_CROSS_DIM, SECTION_LENGTH);
Sphere sphereJoint = new Sphere(20, 20, JOINT_RADIUS);
sphereJoint.setTextureMode(Sphere.TextureMode.Projected);
TangentBinormalGenerator.generate(sphereJoint);
for (int i = 0; i < numJoints; i++) {
// Create pivots
Node pivot = new Node("pivot");
pivots[i] = pivot;
// Create sections
Geometry section = new Geometry("Box", box);
section.setMaterial(matRoboticArm);
sections[i] = section;
// create joints
Geometry sphere = new Geometry("joint", sphereJoint);
sphere.setMaterial(matRoboticArm);
joints[i] = sphere;
}
// Create Head
headNode = new Node("headNode");
Sphere sphereHead = new Sphere(20, 20, HEAD_RADIUS);
sphereHead.setTextureMode(Sphere.TextureMode.Projected);
TangentBinormalGenerator.generate(sphereHead);
head = new Geometry("head", sphereHead);
head.setMaterial(matRoboticArm);
// Create eyes
Sphere sphereEye = new Sphere(20, 20, EYE_RADIUS);
leftEye = new Geometry("leftEye", sphereEye);
leftEye.setMaterial(matRoboticArm);
rightEye = new Geometry("rightEye", sphereEye);
rightEye.setMaterial(matRoboticArm);