Java Reference
In-Depth Information
hbox1.setPadding(new Insets(10, 10, 10, 10));
hbox1.setAlignment(Pos.CENTER);
rotateSlider = new Slider(-180.0d, 180.0d, 60.0d);
rotateSlider.setMinWidth(400.0d);
rotateSlider.setMajorTickUnit(10.0d);
rotateSlider.setMinorTickCount(5);
rotateSlider.setShowTickMarks(true);
rotateSlider.setShowTickLabels(true);
rotateSlider.valueProperty().bindBidirectional(model.rotateProperty());
HBox hbox2 = new HBox(10, new Label("Rotate Around (1, 1, 1) Axis:"),
rotateSlider);
hbox2.setPadding(new Insets(10, 10, 10, 10));
hbox2.setAlignment(Pos.CENTER_LEFT);
VBox controlPanel = new VBox(10, hbox1, hbox2);
controlPanel.setPadding(new Insets(10, 10, 10, 10));
BorderPane root = new BorderPane(meshView, null, null, controlPanel, null);
scene = new Scene(root, 640, 480);
}
private Mesh createSimplex(float length) {
TriangleMesh mesh = new TriangleMesh();
mesh.getPoints().addAll(
0.0f, 0.0f, 0.0f, // O
length, 0.0f, 0.0f, // A
0.0f, length, 0.0f, // B
0.0f, 0.0f, length // C
);
mesh.getTexCoords().addAll(
0.0f, 0.0f,
0.0f, 1.0f,
1.0f, 0.0f,
1.0f, 1.0f
);
mesh.getFaces().addAll(
0, 0, 2, 1, 1, 2, // OBA
0, 0, 3, 1, 2, 2, // OCB
0, 0, 1, 1, 3, 2, // OAC
1, 0, 2, 1, 3, 2 // ABC
);
Search WWH ::




Custom Search