I am a newcomer to javaFX-3D and I want to view simple 3D shapes with labels, such as node numbers etc. I've started from oracle's MoleculeSampleApp and I am trying to add text. Thus far I have arrived at this:
The text has been added as follows:
Text t = new Text("Hello world");
t.setFont(Font.font("Calibri", FontWeight.BOLD, 30));
t.translateXProperty().set(125 + 10);
t.translateYProperty().set(125 + 10);
t.translateZProperty().set(125+10);
Xform from = new Xform();
from.getChildren().add(t);
from.setRotateX(180);
world.getChildren().add(from);
As soon as I start rotating the view, the text also flips all over and it becomes unreadable. Is there a way to make the text not rotate in all directions? Ideally the text should always be displayed like normal "2D" text, while moving along with its associated 3D object as the view is adjusted (zoom, rotate, etc.).