/** * Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system. * </ br></ br> * The image below demonstrates a blue sphere with a 0.15 meter radius generated by the following code:<br /><br /> * {@code linkGraphics.addCoordinateSystem(0.5);}<br /> * {@code linkGraphics.addSphere(0.15, YoAppearance.Blue());}<br /><br /> * * As is show by the graphical representation the sphere is centered on the coordinate system. * Again, x, y and z are red, white and blue. * <br /><br /><img src="doc-files/LinkGraphics.addSphere2.jpg"> * * @param radius radius of the new sphere in meters. * @param sphereAppearance Appearance to be used with the new sphere. See {@link YoAppearance YoAppearance} for implementations. */ public SphereGraphics3DInstruction addSphere(double radius, AppearanceDefinition sphereAppearance) { SphereGraphics3DInstruction instruction = new SphereGraphics3DInstruction(radius, RESOLUTION); instruction.setAppearance(sphereAppearance); graphics3DInstructions.add(instruction); return instruction; }
MeshDataHolder meshData = MeshDataGenerator.Sphere(sphereInstruction.getRadius(), sphereInstruction.getResolution(), sphereInstruction.getResolution()); Graphics3DAddMeshDataInstruction meshDataInstruction = Graphics3DObject.createMeshDataInstruction(meshData, sphereInstruction.getAppearance());
MeshDataHolder meshData = MeshDataGenerator.Sphere(sphereInstruction.getRadius(), sphereInstruction.getResolution(), sphereInstruction.getResolution()); Graphics3DAddMeshDataInstruction meshDataInstruction = Graphics3DObject.createMeshDataInstruction(meshData, sphereInstruction.getAppearance());
MeshDataHolder meshData = MeshDataGenerator.Sphere(sphereInstruction.getRadius(), sphereInstruction.getResolution(), sphereInstruction.getResolution()); Graphics3DAddMeshDataInstruction meshDataInstruction = Graphics3DObject.createMeshDataInstruction(meshData, sphereInstruction.getAppearance());
/** * Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system. * </ br></ br> * The image below demonstrates a blue sphere with a 0.15 meter radius generated by the following code:<br /><br /> * {@code linkGraphics.addCoordinateSystem(0.5);}<br /> * {@code linkGraphics.addSphere(0.15, YoAppearance.Blue());}<br /><br /> * * As is show by the graphical representation the sphere is centered on the coordinate system. * Again, x, y and z are red, white and blue. * <br /><br /><img src="doc-files/LinkGraphics.addSphere2.jpg"> * * @param radius radius of the new sphere in meters. * @param sphereAppearance Appearance to be used with the new sphere. See {@link YoAppearance YoAppearance} for implementations. */ public SphereGraphics3DInstruction addSphere(double radius, AppearanceDefinition sphereAppearance) { SphereGraphics3DInstruction instruction = new SphereGraphics3DInstruction(radius, RESOLUTION); instruction.setAppearance(sphereAppearance); graphics3DInstructions.add(instruction); return instruction; }