Java Code Examples for javafx.scene.shape.Sphere#setTranslateZ()
The following examples show how to use
javafx.scene.shape.Sphere#setTranslateZ() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CubeViewer.java From FXyzLib with GNU General Public License v3.0 | 6 votes |
/** * @param data the xAxisData to set */ public void setxAxisData(ArrayList<Double> data) { xAxisData = data; scatterDataGroup.getChildren().clear(); for(int i=0;i<xAxisData.size();i++) { final Sphere dataSphere = new Sphere(scatterRadius); // final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius()); double translateY = 0.0; double translateZ = 0.0; if(!yAxisData.isEmpty() && yAxisData.size() > i) translateY = yAxisData.get(i); if(!zAxisData.isEmpty() && zAxisData.size() > i) translateZ = zAxisData.get(i); dataSphere.setTranslateX(xAxisData.get(i)); dataSphere.setTranslateY(translateY); dataSphere.setTranslateZ(translateZ); scatterDataGroup.getChildren().add(dataSphere); } }
Example 2
Source File: CubeViewer.java From FXyzLib with GNU General Public License v3.0 | 6 votes |
/** * @param data the yAxisData to set */ public void setyAxisData(ArrayList<Double> data) { yAxisData = data; scatterDataGroup.getChildren().clear(); for(int i=0;i<yAxisData.size();i++) { final Sphere dataSphere = new Sphere(scatterRadius); // final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius()); double translateX = 0.0; double translateZ = 0.0; if(!xAxisData.isEmpty() && xAxisData.size() > i) translateX = xAxisData.get(i); if(!zAxisData.isEmpty() && zAxisData.size() > i) translateZ = zAxisData.get(i); dataSphere.setTranslateX(translateX); dataSphere.setTranslateY(yAxisData.get(i)); dataSphere.setTranslateZ(translateZ); scatterDataGroup.getChildren().add(dataSphere); } }
Example 3
Source File: CubeViewer.java From FXyzLib with GNU General Public License v3.0 | 6 votes |
/** * @param data the zAxisData to set */ public void setzAxisData(ArrayList<Double> data) { zAxisData = data; scatterDataGroup.getChildren().clear(); for(int i=0;i<zAxisData.size();i++) { final Sphere dataSphere = new Sphere(scatterRadius); // final Box dataSphere = new Box(getScatterRadius(), getScatterRadius(), getScatterRadius()); double translateX = 0.0; double translateY = 0.0; if(!xAxisData.isEmpty() && xAxisData.size() > i) translateX = xAxisData.get(i); if(!yAxisData.isEmpty() && yAxisData.size() > i) translateY = yAxisData.get(i); dataSphere.setTranslateX(translateX); dataSphere.setTranslateY(translateY); dataSphere.setTranslateZ(zAxisData.get(i)); scatterDataGroup.getChildren().add(dataSphere); } }
Example 4
Source File: ContentModel.java From gluon-samples with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void buildAxes() { double length = 2d * dimModel; double width = dimModel / 100d; double radius = 2d * dimModel / 100d; final PhongMaterial redMaterial = new PhongMaterial(); redMaterial.setDiffuseColor(Color.DARKRED); redMaterial.setSpecularColor(Color.RED); final PhongMaterial greenMaterial = new PhongMaterial(); greenMaterial.setDiffuseColor(Color.DARKGREEN); greenMaterial.setSpecularColor(Color.GREEN); final PhongMaterial blueMaterial = new PhongMaterial(); blueMaterial.setDiffuseColor(Color.DARKBLUE); blueMaterial.setSpecularColor(Color.BLUE); Sphere xSphere = new Sphere(radius); Sphere ySphere = new Sphere(radius); Sphere zSphere = new Sphere(radius); xSphere.setMaterial(redMaterial); ySphere.setMaterial(greenMaterial); zSphere.setMaterial(blueMaterial); xSphere.setTranslateX(dimModel); ySphere.setTranslateY(dimModel); zSphere.setTranslateZ(dimModel); Box xAxis = new Box(length, width, width); Box yAxis = new Box(width, length, width); Box zAxis = new Box(width, width, length); xAxis.setMaterial(redMaterial); yAxis.setMaterial(greenMaterial); zAxis.setMaterial(blueMaterial); autoScalingGroup.getChildren().addAll(xAxis, yAxis, zAxis); autoScalingGroup.getChildren().addAll(xSphere, ySphere, zSphere); }
Example 5
Source File: ContentModel.java From RubikFX with GNU General Public License v3.0 | 5 votes |
private void buildAxes() { double length = 2d*dimModel; double width = dimModel/100d; double radius = 2d*dimModel/100d; final PhongMaterial redMaterial = new PhongMaterial(); redMaterial.setDiffuseColor(Color.DARKRED); redMaterial.setSpecularColor(Color.RED); final PhongMaterial greenMaterial = new PhongMaterial(); greenMaterial.setDiffuseColor(Color.DARKGREEN); greenMaterial.setSpecularColor(Color.GREEN); final PhongMaterial blueMaterial = new PhongMaterial(); blueMaterial.setDiffuseColor(Color.DARKBLUE); blueMaterial.setSpecularColor(Color.BLUE); Sphere xSphere = new Sphere(radius); Sphere ySphere = new Sphere(radius); Sphere zSphere = new Sphere(radius); xSphere.setMaterial(redMaterial); ySphere.setMaterial(greenMaterial); zSphere.setMaterial(blueMaterial); xSphere.setTranslateX(dimModel); ySphere.setTranslateY(dimModel); zSphere.setTranslateZ(dimModel); Box xAxis = new Box(length, width, width); Box yAxis = new Box(width, length, width); Box zAxis = new Box(width, width, length); xAxis.setMaterial(redMaterial); yAxis.setMaterial(greenMaterial); zAxis.setMaterial(blueMaterial); autoScalingGroup.getChildren().addAll(xAxis, yAxis, zAxis); autoScalingGroup.getChildren().addAll(xSphere, ySphere, zSphere); }