public static Graphics3DNode addRotatingScalingNode(ArrayList<Runnable> runnables, Graphics3DObject teapotObject) { Graphics3DNode teapotAndSphereNode = new Graphics3DNode("teaPot", Graphics3DNodeType.JOINT); teapotAndSphereNode.setGraphicsObject(teapotObject); RotateAndScaleNodeRunnable rotator = new RotateAndScaleNodeRunnable(teapotAndSphereNode); runnables.add(rotator); return teapotAndSphereNode; }
public static Graphics3DNode createPointCloud(String name, List<Point3d> worldPoints, double pointRadius, AppearanceDefinition appearance) { // TODO Change to point sprite mesh Graphics3DNode pointCloud = new Graphics3DNode("PointCloud" + name); for (int i = 0; i < worldPoints.size(); i++) { Graphics3DNode worldPointNode = new Graphics3DNode(name + "point" + i, Graphics3DNodeType.VISUALIZATION, new Graphics3DObject(new Sphere3d(pointRadius), appearance)); worldPointNode.translate(worldPoints.get(i).getX(), worldPoints.get(i).getY(), worldPoints.get(i).getZ()); pointCloud.addChild(worldPointNode); } return pointCloud; }
public void translateTo(double x, double y, double z) { translateTo(new Vector3d(x, y, z)); }
public static void addJiggle(Graphics3DNode node,Graphics3DAdapter adapter,ArrayList<Runnable> runnables) { // adapter.removeRootNode(node); Graphics3DNode jiggleNode = new Graphics3DNode("jiggle", Graphics3DNodeType.JOINT); jiggleNode.addChild(node); // adapter.addRootNode(jiggleNode); RotateAndScaleNodeRunnable jiggler = new RotateAndScaleNodeRunnable(node); runnables.add(jiggler); } public static void addFirstCamera(Graphics3DAdapter graphics3DAdapter, PanBackAndForthTrackingAndDollyPositionHolder cameraTrackAndDollyVariablesHolder)
Graphics3DNode node1 = new Graphics3DNode("node1", Graphics3DNodeType.JOINT); node1.setTransform(transform1); Graphics3DNode node2 = new Graphics3DNode("node2", Graphics3DNodeType.JOINT); Graphics3DNode rootNode = new Graphics3DNode("rootNode", Graphics3DNodeType.JOINT); node1.setGraphicsObject(object1); node2.setGraphicsObject(object2); rootNode.addChild(node1); rootNode.addChild(node2); node2.addSelectedListener(selectedListener); node2.getTransform().setRotationYaw(rotation); node2.getTransform().setTranslationToZero(); node1.setGraphicsObject(randomObject); count = 0;
public Boolean doExample(Graphics3DAdapter graphics3DAdapter) Graphics3DNode teapotAndSphereNode = new Graphics3DNode("teaPot", Graphics3DNodeType.JOINT); Graphics3DObject teapotObject = new Graphics3DObject(); teapotObject.setChangeable(true); Graphics3DInstruction teapotAppearanceHolder = teapotObject.addTeaPot(YoAppearance.Red()); teapotAndSphereNode.setGraphicsObject(teapotObject); graphics3DAdapter.addRootNode(teapotAndSphereNode); BlinkRunnable blinker = new BlinkRunnable(teapotAppearanceHolder); Graphics3DNode box = new Graphics3DNode("box", Graphics3DNodeType.JOINT); Graphics3DObject boxGraphics = new Graphics3DObject(); boxGraphics.addCube(1.0, 1.0, 1.0, YoAppearance.Green()); box.setGraphicsObject(boxGraphics); graphics3DAdapter.addRootNode(box); box.addSelectedListener(selectedListener);
graphic.addCylinder(5.0, 0.2, YoAppearance.Red()); final Graphics3DNode rayNode = new Graphics3DNode("laserRay", Graphics3DNodeType.VISUALIZATION); tInit.setRotationPitchAndZeroTranslation(Math.PI / 4.0); rayNode.setTransform(tInit); rayNode.setGraphicsObject(graphic);
private JMEGraphics3DNode addNodesRecursively(Graphics3DNode graphics3dNode, Node parentNode) { JMEGraphics3DNode jmeNode = new JMEGraphics3DNode(graphics3dNode, assetManager, null, null); Graphics3DNodeType nodeType = graphics3dNode.getNodeType(); jmeNode.setType(nodeType); parentNode.attachChild(jmeNode); for (Graphics3DNode child : graphics3dNode.getChildrenNodes()) { addNodesRecursively(child, jmeNode); } return jmeNode; }
public Vector3d getTranslation() { Vector3d translation = new Vector3d(); getTransform().getTranslation(translation); return translation; }
private void init() { rootNode = new Graphics3DNode(worldName + "RootNode"); }
private void addLidarNode() { lidarNode = new Graphics3DNode("lidar", new Graphics3DObject()); lidarNode.getGraphics3DObject().addModelFile("models/hokuyo.dae", YoAppearance.Black()); lidarNode.getGraphics3DObject().addCoordinateSystem(1.0); addChild(lidarNode); }
public void addPoints(List<Point3D> points) { if(!disableGraphics) { for(Point3D point : points) { Graphics3DObject testCubeGraphicObject = new Graphics3DObject(); testCubeGraphicObject.addCube(VOXEL_SIZE, VOXEL_SIZE, VOXEL_SIZE, YoAppearance.Aqua()); Graphics3DNode cubeNode = scs.addStaticLinkGraphics(testCubeGraphicObject, Graphics3DNodeType.VISUALIZATION); cubeNode.translate(point.getX(), point.getY(), point.getZ()); if(rootNode == null) rootNode = cubeNode; else rootNode.addChild(cubeNode); } } }
public void update() if (graphics3dNode.getHasGraphicsObjectChanged()) Transform3d transform = graphics3dNode.getTransform(); transform.get(rotation, translation); transform.getScale(scale);
public Graphics3DNode(String name, Graphics3DNodeType nodeType, Graphics3DObject graphicsObject) { this.name = name; this.nodeType = nodeType; if (graphicsObject != null) { setGraphicsObject(graphicsObject); } }
private void recursivelyRemoveNodesFromMap(Graphics3DNode rootNode) { synchronized (graphicsConch) { for (Graphics3DNode child : rootNode.getChildrenNodes()) { recursivelyRemoveNodesFromMap(child); } jmeGraphicsNodes.remove(rootNode); } }
public void addChild(Graphics3DNode child) { if (viewportAdapter == null) { rootNode.addChild(child); } else { graphics3DNodesToAddPostFrame.add(child); } }
public JavaFXGraphics3DNode(Graphics3DNode graphicsNode, AppearanceDefinition appearance) { this.graphicsNode = graphicsNode; javaFXGraphicsObject = new JavaFXGraphicsObject(graphicsNode.getGraphics3DObject(), appearance); this.getChildren().add(javaFXGraphicsObject.getGroup()); }
public static void addSimpleSelectedListener(Graphics3DAdapter graphics3DAdapter, Graphics3DNode box) { SelectedListener selectedListener = new SelectedListener() { public void selected(Graphics3DNode graphics3dNode, ModifierKeyInterface modifierKeyHolder, Point3d location, Point3d cameraLocation, Quat4d cameraRotation) { System.out.println("Selected " + graphics3dNode.getName() + " @ location " + location); } }; graphics3DAdapter.addSelectedListener(selectedListener); box.addSelectedListener(selectedListener); }
Graphics3DNode node1 = new Graphics3DNode("node1", Graphics3DNodeType.JOINT); node1.setTransform(transform1); Graphics3DNode node2 = new Graphics3DNode("node2", Graphics3DNodeType.JOINT); Graphics3DNode rootNode = new Graphics3DNode("rootNode", Graphics3DNodeType.JOINT); node1.setGraphicsObject(object1); node2.setGraphicsObject(object2); rootNode.addChild(node1); rootNode.addChild(node2); node2.addSelectedListener(selectedListener); node2.getTransform().setRotationYawAndZeroTranslation(rotation); node1.setGraphicsObject(randomObject); count = 0;