private void populateDynamicsGraphicObjects(YoGraphicsListRegistry yoGraphicsListRegistry) { perturbanceApplicationPoint = new YoFramePoint3D("perturbanceApplicationPoint", "", ReferenceFrame.getWorldFrame(), registry); YoGraphicVector perturbanceVisual = new YoGraphicVector("perturbanceVisual" + name, perturbanceApplicationPoint, perturbanceForce, 0.005, YoAppearance.BlackMetalMaterial()); yoGraphicsListRegistry.registerYoGraphic(name, perturbanceVisual); }
private Graphics3DObject createCylinderGeometry(double length, double radius, AppearanceDefinition color, Vector3D cylinderZAxisInWorld, Vector3D parentJointOffsetFromCoM) { Graphics3DObject ret = new Graphics3DObject(); ret.addSphere(1.5*radius, YoAppearance.BlackMetalMaterial()); ret.identity(); ret.translate(parentJointOffsetFromCoM); AxisAngle cylinderRotationFromZup; if (parentJointOffsetFromCoM.length() > 0.0) cylinderRotationFromZup = EuclidGeometryTools.axisAngleFromZUpToVector3D(parentJointOffsetFromCoM); else cylinderRotationFromZup = EuclidGeometryTools.axisAngleFromZUpToVector3D(cylinderZAxisInWorld); ret.rotate(cylinderRotationFromZup); ret.translate(0.0, 0.0, -length / 2.0); ret.addCylinder(length, radius, color); return ret; }
AppearanceDefinition app = YoAppearance.BlackMetalMaterial();
AppearanceDefinition app = YoAppearance.BlackMetalMaterial();
terrain.addBox(xStart + edgeThick, yEnd - edgeThick, xEnd - edgeThick, yEnd, 0.8 + edgeHeight, YoAppearance.Brown()); ballRobot = new ContactableSphereRobot("DatBall", ballRadius, ballMass, YoAppearance.BlackMetalMaterial()); Point3D[] contactPointsOffset = SpiralBasedAlgorithm.generatePointsOnSphere(ballRadius, 500); for (int i = 0; i < contactPointsOffset.length; i++)
private Graphics3DObject createBoneGeometry(double length, double radius, AppearanceDefinition color, Vector3D cylinderZAxisInWorld, Vector3D parentJointOffsetFromCoM) { Graphics3DObject ret = new Graphics3DObject(); ret.identity(); ret.addSphere(1.5*radius, YoAppearance.BlackMetalMaterial()); ret.translate(parentJointOffsetFromCoM); AxisAngle cylinderRotationFromZup; if (parentJointOffsetFromCoM.length() > 0.0) cylinderRotationFromZup = EuclidGeometryTools.axisAngleFromZUpToVector3D(parentJointOffsetFromCoM); else cylinderRotationFromZup = EuclidGeometryTools.axisAngleFromZUpToVector3D(cylinderZAxisInWorld); ret.rotate(cylinderRotationFromZup); ret.translate(0.0, 0.0, -0.5 * length); ret.addCone(1.0 * length, radius, color); ret.translate(0.0, 0.0, 0.5 * length); Vector3D rotationAxis = new Vector3D(cylinderRotationFromZup.getX(), cylinderRotationFromZup.getY(), cylinderRotationFromZup.getZ()); AxisAngle another180DegreeRotation = new AxisAngle(rotationAxis, Math.PI); ret.rotate(another180DegreeRotation); ret.translate(0.0, 0.0, -0.5 * length); ret.addCone(1.0 * length, radius, color); ret.translate(0.0, 0.0, 0.5 * length); return ret; }
linkGraphics.addPyramidCube(PYRAMID_CUBE_LX, PYRAMID_CUBE_LY, PYRAMID_CUBE_LZ, PYRAMID_CUBE_LH, YoAppearance.BlackMetalMaterial());