I have a scene written in Java 3d where the user’s viewing position is set to some coordinate using the following code:
ViewingPlatform vp = simpleUniverse.getViewingPlatform(); TransformGroup steerTG = vp.getViewPlatformTransform(); Transform3D t3d = new Transform3D(); steerTG.getTransform(t3d); t3d.lookAt( new Point3d(-5, 10, 25), new Point3d(0, 0, 0), new Vector3d(0, 1, 0)); t3d.invert(); steerTG.setTransform(t3d);
Now I need to put an inscription on top of the scene, which is always visible, for example, some text. I tried the following, but to no avail:
PlatformGeometry pg = new PlatformGeometry(); Text2D text = new Text2D("Text to display", Cell.BLACK, "Verdana", 18, 1); pg.addChild(text); simpleUniverse.getViewingPlatform().setPlatformGeometry(pg);
When I run the above code, I don’t see any text at all. Can anybody help?
java 3d opengl java-3d
Cuga
source share