I tried to make a plane in JavaFX application using official tutorial and has the next code:
Image diifuseMap = new Image(getClass().getResource("t.jpg").toExternalForm());
TriangleMesh planeMesh = new TriangleMesh();
float[] points = {
-5, 5, 0,
-5, -5, 0,
5, 5, 0,
5, -5, 0
};
float[] texCoords = {
0, 0,
0, 1,
1, 0,
1, 1
};
int[] faces = {
0, 0, 1, 1, 2, 2,
2, 2, 3, 3, 1, 1
};
planeMesh.getPoints().addAll(points);
planeMesh.getTexCoords().addAll(texCoords);
planeMesh.getFaces().addAll(faces);
MeshView meshView = new MeshView(planeMesh);
meshView.setMaterial(new PhongMaterial(Color.BLACK, diifuseMap, null, null, null));
Group3D plane = new Group3D(new MeshView(planeMesh));
But, unfortunately, nothing appeared in the scene. Can anybody explain how to create my own 3d models in JavaFX? And is it possible to create them without texture(I want wireframe model)?