public KnotMesh(double majorRadius, double minorRadius, double wireRadius, double p, double q, int rDivs, int tDivs, int lengthCrop, int wireCrop) { setMajorRadius(majorRadius); setMinorRadius(minorRadius); setWireRadius(wireRadius); setP(p); setQ(q); setLengthDivisions(rDivs); setWireDivisions(tDivs); setLengthCrop(lengthCrop); setWireCrop(wireCrop); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public IcosahedronMesh(int level, float diameter){ setLevel(level); setDiameter(diameter); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); diameterProperty().addListener((obs,f0,f1)->{ if(mesh!=null && f0!=null && f1!=null && f0.floatValue()>0 && f1.floatValue()>0){ updateVertices(f1.floatValue()/f0.floatValue()); } }); levelProperty().addListener((obs,i0,i1)->{ if(mesh!=null && i1!=null && i1.intValue()>=0){ updateMesh(); } }); }
public CurvedSpringMesh(double majorRadius, double minorRadius, double wireRadius, double pitch, double length, int rDivs, int tDivs, int lengthCrop, int wireCrop) { setMajorRadius(majorRadius); setMinorRadius(minorRadius); setWireRadius(wireRadius); setPitch(pitch); setLength(length); setLengthDivisions(rDivs); setWireDivisions(tDivs); setLengthCrop(lengthCrop); setWireCrop(wireCrop); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public SpringMesh(double meanRadius, double wireRadius, double pitch, double length, int rDivs, int tDivs, int lengthCrop, int wireCrop) { setMeanRadius(meanRadius); setWireRadius(wireRadius); setPitch(pitch); setLength(length); factor=length/pitch; setLengthDivisions(rDivs); setWireDivisions(tDivs); setLengthCrop(lengthCrop); setWireCrop(wireCrop); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
/** * Construct a new MultiLine3D object. * * @param lines list of lines */ public MultiLine3D(List<Line3D> lines) { lineMaterial.setDiffuseColor(color); lineMaterial.setSpecularColor(color); //The MeshView allows you to control how the TriangleMesh is rendered meshView.setDrawMode(DrawMode.FILL); //Fill so that the line shows width // meshView.setDrawMode(DrawMode.LINE); // only show lines meshView.setCullFace(CullFace.NONE); // no culling (backs are black) meshView.setMaterial(lineMaterial); this.getChildren().add(meshView); // add dummy Texture Coordinate mesh.getTexCoords().addAll(0, 0); setDepthTest(DepthTest.INHERIT); if (!lines.isEmpty()) { refresh(lines); } }
private void init(Stage primaryStage) { Group root = new Group(); root.setDepthTest(DepthTest.ENABLE); primaryStage.setResizable(false); primaryStage.setScene(new Scene(root, 400, 150, true)); primaryStage.getScene().setCamera(new PerspectiveCamera()); root.getTransforms().addAll( new Translate(400 / 2, 150 / 2), new Rotate(180, Rotate.X_AXIS) ); root.getChildren().add(create3dContent()); }
private void init(Stage primaryStage) { Group root = new Group(); root.setDepthTest(DepthTest.ENABLE); primaryStage.setResizable(false); primaryStage.setScene(new Scene(root, 500, 500, true)); primaryStage.getScene().setCamera(new PerspectiveCamera()); root.getTransforms().addAll( new Translate(500 / 2, 500 / 2), new Rotate(180, Rotate.X_AXIS) ); root.getChildren().add(create3dContent()); }
private void init(Stage primaryStage) { Group root = new Group(); root.setDepthTest(DepthTest.ENABLE); primaryStage.setResizable(false); primaryStage.setScene(new Scene(root, 400, 500, true)); primaryStage.getScene().setCamera(new PerspectiveCamera()); root.getTransforms().addAll( new Translate(400 / 2, 500 / 2 + 100), new Rotate(180, Rotate.X_AXIS) ); root.getChildren().add(create3dContent()); }
protected Sample3D(double width, double height) { super(width, height); Group group3d = new Group(create3dContent()); group3d.setDepthTest(DepthTest.ENABLE); group3d.getTransforms().addAll( new Translate(width / 2, height / 2), new Rotate(180, Rotate.X_AXIS) ); getChildren().add(group3d); }
private static Group createViewer(final MediaPlayer player, final double scale, boolean blur) { Group mediaGroup = new Group(); final MediaView mediaView = new MediaView(player); if (blur) { BoxBlur bb = new BoxBlur(); bb.setWidth(4); bb.setHeight(4); bb.setIterations(1); mediaView.setEffect(bb); } double width = player.getMedia().getWidth(); double height = player.getMedia().getHeight(); mediaView.setFitWidth(width); mediaView.setTranslateX(-width/2.0); mediaView.setScaleX(-scale); mediaView.setFitHeight(height); mediaView.setTranslateY(-height/2.0); mediaView.setScaleY(scale); mediaView.setDepthTest(DepthTest.ENABLE); mediaGroup.getChildren().add(mediaView); return mediaGroup; }
@Override protected Scene getScene() { Scene zScene = super.getScene(); zScene.getRoot().setDepthTest(DepthTest.ENABLE); zScene.setCamera(new PerspectiveCamera()); //System.out.println("Camera angle " + new PerspectiveCamera().getFieldOfView()); return zScene; }
private void iterate(TestCore core) { boolean doneWell = true; for(final DepthTestScene.Nodes node1: DepthTestScene.Nodes.values()) { for(final DepthTestScene.Nodes node2: DepthTestScene.Nodes.values()) { for(final DepthTest dt1: DepthTest.values()) { for(final DepthTest dt2: DepthTest.values()) { for(final DepthTest dt3: new DepthTest[]{DepthTest.DISABLE, DepthTest.ENABLE}) { for(final ToggleButtonWrap<? extends RadioButton> tbw: new ToggleButtonWrap[]{firstToFront, secondToFront}) { new GetAction<Object>() { @Override public void run(Object... os) throws Exception { firstNodeCombo.getControl().getSelectionModel().select(node1); secondNodeCombo.getControl().getSelectionModel().select(node2); firstDTest.getControl().getSelectionModel().select(dt1); secondDTest.getControl().getSelectionModel().select(dt2); parentDTest.getControl().getSelectionModel().select(dt3); tbw.getControl().fire(); } }.dispatch(Root.ROOT.getEnvironment()); firstNode = byID(getScene(), firstNodeCombo.getControl().getValue().toString() + "-green", Node.class); secondNode = byID(getScene(), secondNodeCombo.getControl().getValue().toString() + "-red", Node.class); doneWell &= core.execute(); } } } } } } Assert.assertTrue(doneWell); }
public Parent createContent() { BorderPane p = new BorderPane(); HBox btBox = new HBox(50, leftBt, lookLeftBt, forwardBt, upBt, downBt, backBt, lookRightBt, rightBt); btBox.alignmentProperty().set(Pos.CENTER); p.setBottom(btBox); setUpButtons(); PerspectiveCamera camera = new PerspectiveCamera(true); camera.getTransforms().add(cameraTranslate); camera.getTransforms().add(cameraRotate); camera.setFieldOfView(50); camera.setFarClip(10000); camera.setNearClip(1); p.setDepthTest(DepthTest.ENABLE); BorderPane cirmLiveUI = cirmLive.createSceneContent(); cirmLiveUI.setCache(true); cirmLiveUI.setCacheShape(true); cirmLiveUI.setCacheHint(CacheHint.QUALITY); //cirmLiveUI.setSsetAlignment(camera, Pos.CENTER); //cirmLiveUI.setTranslateZ(500); //TODO root.getChildren().addAll(c, c2, c3); SubScene subScene = new SubScene(cirmLiveUI, 1600, 900, true, SceneAntialiasing.BALANCED); subScene.setFill(Color.CORAL); subScene.setCamera(camera); p.setCenter(subScene); return p; }
private void init() { getChildren().add(histogramDataGroup); if (selfLightEnabled) { getChildren().add(selfLight); } setDepthTest(DepthTest.ENABLE); }
private void init(){ getChildren().add(scatterDataGroup); //Holds ScatterPlot data if(selfLightEnabled) { getChildren().add(selfLight); } setDepthTest(DepthTest.ENABLE); }
public CuboidMesh(double width, double height, double depth, int level, Point3D center){ setWidth(width); setHeight(height); setDepth(depth); setLevel(level); setCenter(center); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public SurfacePlotMesh(Function<Point2D,Number> function, double rangeX, double rangeY, int divisionsX, int divisionsY, double functionScale) { setFunction2D(function); setRangeX(rangeX); setRangeY(rangeY); setDivisionsX(divisionsX); setDivisionsY(divisionsY); setFunctionScale(functionScale); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public PrismMesh(double radius, double height, int level, Point3D pIni, Point3D pEnd){ setAxisOrigin(pIni==null?new Point3D(0,(float)height/2f,0):pIni); setAxisEnd(pEnd==null?new Point3D(0,-(float)height/2f,0):pEnd); setRadius(radius); setHeight(getAxisEnd().substract(getAxisOrigin()).magnitude()); setLevel(level); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public SegmentedTorusMesh(int rDivs, int tDivs, int crop, double majorRadius, double minorRadius) { setMajorRadiusDivisions(rDivs); setMinorRadiusDivisions(tDivs); setMajorRadiusCrop(crop); setMajorRadius(majorRadius); setMinorRadius(minorRadius); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public BezierMesh(BezierHelper spline, double wireRadius, int rDivs, int tDivs, int lengthCrop, int wireCrop) { setSpline(spline); setWireRadius(wireRadius); setLengthDivisions(rDivs); setWireDivisions(tDivs); setLengthCrop(lengthCrop); setWireCrop(wireCrop); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public TorusMesh(int rDivs, int tDivs, double radius, double tRadius) { setRadiusDivisions(rDivs); setTubeDivisions(tDivs); setRadius(radius); setTubeRadius(tRadius); setDepthTest(DepthTest.ENABLE); updateMesh(); }
public SegmentedSphereMesh(int tDivs, int cropX, int cropY, double radius, Point3D center) { setRadiusDivisions(tDivs); setRadiusCropX(cropX); setRadiusCropY(cropY); setRadius(radius); setzOffset(1); setCenter(center); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public FrustumMesh(double majorRadius, double minorRadius, double height, int level, Point3D pIni, Point3D pEnd){ setAxisOrigin(pIni==null?new Point3D(0,(float)height/2f,0):pIni); setAxisEnd(pEnd==null?new Point3D(0,-(float)height/2f,0):pEnd); setMajorRadius(majorRadius); setMinorRadius(minorRadius); setLevel(level); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public TetrahedraMesh(double height, int level, Point3D center){ setHeight(height); setLevel(level); setCenter(center); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
private void init(){ buildAxes(axesSize, axesThickness); buildPanels(axesSize); buildGrids(axesSize, gridLineSpacing); buildEventHandlers(); getChildren().add(scatterDataGroup); //Holds ScatterPlot data if(selfLightEnabled) { PointLight light = new PointLight(Color.WHITE); getChildren().add(light); } setDepthTest(DepthTest.ENABLE); }
public CuboidMesh(double width, double height, double depth, int level){ setWidth(width); setHeight(height); setDepth(depth); setLevel(level); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }
public SurfacePlotMesh(Function<Point2D,Number> function, double rangeX, double rangeY, int divisionsX, int divisionsY, double scale) { setFunction2D(function); setRangeX(rangeX); setRangeY(rangeY); setDivisionsX(divisionsX); setDivisionsY(divisionsY); setScale(scale); updateMesh(); setCullFace(CullFace.BACK); setDrawMode(DrawMode.FILL); setDepthTest(DepthTest.ENABLE); }