I'm a beginner in JavaFx 3d modelling. I'm trying to create a 3d-model of boxes in a room. I have the dimensions of the boxes and the coords from the front-left-bottom corner of every box. I've tried to set the coords with setTranslateX(), but the result isn't correct. Here is the pice of my code where I try to set the coords:
for (int i = 0; i < Main.load.size(); i++) {
Load l=Main.load.get(i);
Box sphere = new Box(l.getLength()*10, l.getWidth()*10, l.getHeight()*10);
sphere.setTranslateX(l.getX()*10);
sphere.setTranslateY(l.getY()*10);
sphere.setTranslateZ(l.getZ()*10);
PhongMaterial m = new PhongMaterial();
m.setDiffuseColor(new Color(Math.random(),Math.random(),Math.random(),1));
m.setSpecularColor(Color.BLACK);
sphere.setMaterial(m);
root.getChildren().add(sphere);
}
I hope someone can help me.
Here is an example:
Sizes: blue (30,50,50) pink (10,10,20)
Position: blue (0,0,0) pink (30,0,0)