Michael here, I am a newbie: I am trying to teach my mechanical man how to walk. The legs emulate walking but the axis of rotation is too high on the X-axis. The upper legs separate from the hip as the legs move back and forward. I need to know how to bring the axis of rotation down so the legs will stay in contact with the hips. Please can any one help me with this? I can not find any information about it anywhere. Michael Carter, PUC student Here is my sample code below for the legs walking. ----------------- Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE | Alpha.DECREASING_ENABLE, 0, 0, 2000, 0, 1000, 2000, 0, 1000); // --------------------- RotationInterpolator rotatorLeftLeg = new RotationInterpolator(rotationAlpha, leftLeg); AxisAngle4f faxisOfRot = new AxisAngle4f(0.0f,0.0f,1.0f,(float)Math.PI/2.0f); Transform3D faxisT3D = new Transform3D() ; faxisT3D.set(faxisOfRot) ;
rotatorLeftLeg.setMinimumAngle( (float)Math.PI/-12.0f); rotatorLeftLeg.setMaximumAngle( (float)(Math.PI/-12.0f + Math.PI/6.0f )); rotatorLeftLeg.setAxisOfRotation(faxisT3D); // --------------------- RotationInterpolator rotatorRightLeg = new RotationInterpolator(rotationAlpha, rightLeg);
faxisOfRot = new AxisAngle4f( 0.0f,0.0f,1.0f,(float)Math.PI/-2.0f); faxisT3D = new Transform3D(); faxisT3D.set(faxisOfRot); rotatorRightLeg.setMinimumAngle((float) Math.PI/-12.0f); rotatorRightLeg.setMaximumAngle((float) (Math.PI/-12.0f + Math.PI/6.0f )); rotatorRightLeg.setAxisOfRotation(faxisT3D); // --------------------
BoundingSphere bounds = new BoundingSphere(); rotatorLeftLeg.setSchedulingBounds(bounds); leftLeg.addChild(rotatorLeftLeg); rotatorRightLeg.setSchedulingBounds(bounds); rightLeg.addChild(rotatorRightLeg); |
- Re: [JAVA3D] mechanical man needs lower axis of rotation Michael Carter