private void addText(final Group bg, final String s, final Point3f pos, final Color3f c) { final Transform3D translation = new Transform3D(); translation.setTranslation(new Vector3f(-radius, -radius, 0)); final TransformGroup tg = new TransformGroup(translation); final Text2D t2d = new Text2D(s, c, "Helvetica", 24, Font.PLAIN); t2d.setRectangleScaleFactor(0.03f); final Geometry g = t2d.getGeometry(); final Appearance a = t2d.getAppearance(); final RenderingAttributes ra = new RenderingAttributes(); ra.setDepthTestFunction(RenderingAttributes.ALWAYS); a.setRenderingAttributes(ra); g.setCapability(Geometry.ALLOW_INTERSECT); final OrientedShape3D textShape = new OrientedShape3D(); textShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE); textShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE); textShape.setAlignmentMode(OrientedShape3D.ROTATE_ABOUT_POINT); textShape.setAlignmentAxis(0.0f, 1.0f, 0.0f); textShape.setRotationPoint(new Point3f()); textShape.setConstantScaleEnable(true); textShape.setGeometry(g); textShape.setAppearance(a); tg.setCapability(ENABLE_PICK_REPORTING); tg.setPickable(true); tg.addChild(textShape); bg.addChild(tg); }