public static void makeTransparent(AppearanceDefinition appearance, double f) { appearance.setTransparency(f); }
private static Material convertMaterial(AppearanceDefinition appearance) { float r = appearance.getColor().getX(); float g = appearance.getColor().getY(); float b = appearance.getColor().getZ(); double transparency = appearance.getTransparency(); if (appearance instanceof YoAppearanceRGBColor) { transparency = 1.0 - transparency; } Color color = new Color(r, g, b, transparency); PhongMaterial res = new PhongMaterial(color); res.setSpecularColor(Color.WHITE); return res; }
public void setArrowColor(AppearanceDefinition arrowColor) { this.arrowColor = arrowColor; colorRGB32BitInt = arrowColor.getAwtColor().getRGB(); transparency = arrowColor.getTransparency(); }
appearance = new YoAppearanceRGBColor(DEFAULT_APPEARANCE.getColor(), 0.0); appearance.setTransparency(Double.parseDouble(sdfVisual.getTransparency()));
private static YoArtifactOval yoArtifactOvalFromMessage(String name, YoVariable<?>[] vars, double[] consts, AppearanceDefinition appearance) { return new YoArtifactOval(name, (YoDouble) vars[0], (YoDouble) vars[1], (YoDouble) vars[2], appearance.getColor().get()); }
if (appearance.getTransparency() < 0.99)
public SmartCMPProjector(YoGraphicsListRegistry graphicsListRegistry, YoVariableRegistry parentRegistry) { activeProjection.set(ProjectionMethod.NONE); if (parentRegistry != null) parentRegistry.addChild(registry); if (graphicsListRegistry != null) { YoArtifactPosition desiredCMPViz = new YoArtifactPosition("Desired CMP Position", yoDesiredCMP, GraphicType.SOLID_BALL, DarkRed().getAwtColor(), 0.008); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), desiredCMPViz); YoArtifactPosition projectedCMPViz = new YoArtifactPosition("Projected CMP Position", yoProjectedCMP, GraphicType.BALL_WITH_ROTATED_CROSS, DarkRed().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectedCMPViz); YoArtifactPolygon projectionAreaViz = new YoArtifactPolygon("CMP Projection Area", yoProjectionArea, Blue().getAwtColor(), false); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectionAreaViz); } }
private static YoArtifactPosition yoArtifactPositionFromMessage(String name, YoVariable<?>[] vars, double[] consts, AppearanceDefinition appearance) { return new YoArtifactPosition(name, (YoDouble) vars[0], (YoDouble) vars[1], YoGraphicPosition.GraphicType.values()[(int) (double) consts[1]], appearance.getColor().get(), consts[0]); }
if (appearance.getTransparency() < 0.99)
YoArtifactPosition capturePointViz = new YoArtifactPosition("Capture Point", yoCapturePoint, GraphicType.BALL_WITH_ROTATED_CROSS, Blue().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), capturePointViz); YoArtifactPosition desiredCMPViz = new YoArtifactPosition("Desired CMP Position", yoDesiredCMP, GraphicType.SOLID_BALL, DarkRed().getAwtColor(), 0.008); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), desiredCMPViz); DarkRed().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectedCMPViz); yoProjectedCMP.set(projectedCMP); YoArtifactPolygon projectionAreaViz = new YoArtifactPolygon("CMP Projection Area", yoProjectionArea, Blue().getAwtColor(), false); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectionAreaViz); yoProjectionArea.set(projectionArea); YoArtifactPosition expectedCMPViz = new YoArtifactPosition("Expected Projection", yoExpectedCMP, GraphicType.BALL, LawnGreen().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), expectedCMPViz); YoArtifactPolygon expectedAreaViz = new YoArtifactPolygon("Expected CMP Area", yoExpectedArea, LawnGreen().getAwtColor(), false, 4); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), expectedAreaViz); yoExpectedArea.set(expectedArea); Beige().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), finalCapturePointViz); yoFinalCapturePoint.set(finalCapturePoint);
public static void makeTransparent(AppearanceDefinition appearance, double f) { appearance.setTransparency(f); }
appearanceMessage.setX(obj.getAppearance().getColor().getX()); appearanceMessage.setY(obj.getAppearance().getColor().getY()); appearanceMessage.setZ(obj.getAppearance().getColor().getZ()); appearanceMessage.setTransparency(obj.getAppearance().getTransparency()); objectMessage.setAppearance(appearanceMessage.build());
private static YoArtifactPolygon yoArtifactPolygonFromMessage(String name, YoVariable<?>[] vars, double[] consts, AppearanceDefinition appearance) { ReferenceFrame referenceFrame = ReferenceFrame.getWorldFrame(); int i = 0; YoInteger yoNumVertices = (YoInteger) vars[i++]; ArrayList<YoFramePoint2D> yoFramePoints = new ArrayList<YoFramePoint2D>(); while (i < vars.length) { yoFramePoints.add(new YoFramePoint2D((YoDouble) vars[i++], (YoDouble) vars[i++], referenceFrame)); } YoFrameConvexPolygon2D convexPolygon2d = new YoFrameConvexPolygon2D(yoFramePoints, yoNumVertices, referenceFrame); return new YoArtifactPolygon(name, convexPolygon2d, appearance.getColor().get(), consts[0] > 0); }
private CombinedTerrainObject3D setupWallSlightlyInFront(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); double xStart = 0.6; AppearanceDefinition appearance = YoAppearance.Green(); appearance.setTransparency(0.25); combinedTerrainObject.addBox(xStart, wallMinY, xStart + 0.1, wallMaxY, 0.5, 1.8, appearance); return combinedTerrainObject; }
appearanceMessage.setR(obj.getAppearance().getColor().getX()); appearanceMessage.setG(obj.getAppearance().getColor().getY()); appearanceMessage.setB(obj.getAppearance().getColor().getZ()); appearanceMessage.setTransparency(obj.getAppearance().getTransparency());
private static YoArtifactLineSegment2d yoArtifactLineSegment2DFromMessage(String name, YoVariable<?>[] vars, double[] consts, AppearanceDefinition appearance) { YoFrameLineSegment2D segment = new YoFrameLineSegment2D((YoDouble) vars[0], (YoDouble) vars[1], (YoDouble) vars[2], (YoDouble) vars[3], ReferenceFrame.getWorldFrame()); return new YoArtifactLineSegment2d(name, segment, appearance.getColor().get()); }
private static void setUpTruss(CombinedTerrainObject3D combinedTerrainObject, double[] newPoint, double trussLength, double trussSide, double courseAngleDeg, AppearanceDefinition color) { AppearanceDefinition overrideColor = YoAppearance.White(); // color; overrideColor.setTransparency(0.95); TrussWithSimpleCollisions truss = new TrussWithSimpleCollisions(newPoint, trussLength, trussSide, courseAngleDeg, overrideColor); combinedTerrainObject.addTerrainObject(truss); }
@Override public Artifact createArtifact() { Color3f color3f = appearance.getColor(); return new YoArtifactLineSegment2d(getName(), new YoFrameLineSegment2d(baseX, baseY, x, y, ReferenceFrame.getWorldFrame()), new Color(color3f.getX(), color3f.getY(), color3f.getZ())); }
private void addIntertialEllipsoidsToVisualizer(FloatingRootJointRobot valkyrieRobot) { ArrayList<Joint> joints = new ArrayList<>(); joints.add(valkyrieRobot.getRootJoint()); HashSet<Link> links = getAllLinks(joints, new HashSet<Link>()); for (Link l : links) { AppearanceDefinition appearance = YoAppearance.Green(); appearance.setTransparency(0.6); l.addEllipsoidFromMassProperties(appearance); l.addCoordinateSystemToCOM(0.5); // l.addBoxFromMassProperties(appearance); } }
YoGraphicPosition.GraphicType.values()[(int) (double) consts[1]], appearance.getColor().get(), consts[0]); (DoubleYoVariable) vars[2], appearance.getColor().get()); ReferenceFrame.getWorldFrame()); return new YoArtifactLineSegment2d(name, segment, appearance.getColor().get()); return new YoArtifactPolygon(name, convexPolygon2d, appearance.getColor().get(), consts[0] > 0);