Has anybody also have problems with Billboards that rotate a
text3d about a point. I wrote a progam with a tg. at this tg I add a Sphere and
a text3d object. the text3d object has an billboard that rotate the text object
about a point to the position of the view.
When I zoom behind the spehre or translate the scene with the standard
mouse behaviors too fast, the scene begins to flicker and the text3d object runs off.
 
could anyoune help??
 
code for making text3d with billboard
--------------------------------------------------------------------------------------
public TransformGroup makeText(String text, int textSize)
 {
  font3d = new Font3D(new Font("Helvetica", Font.PLAIN, textSize), new  FontExtrusion());
  tg = new TransformGroup();
  tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
  billboard = new Billboard(tg);
  billboard.setAlignmentMode(Billboard.ROTATE_ABOUT_POINT);
  
  BoundingSphere  bounds  = new BoundingSphere( new Point3d( 0.0, 0.0, 0.0 ), 5000.0 );
  billboard.setSchedulingBounds(bounds);
  Text3D textGeom = new Text3D(font3d, text, new Point3f(0.0f, 7.0f, 0.0f),Text3D.ALIGN_CENTER,  Text3D.PATH_RIGHT);
  Shape3D textShape = new Shape3D(textGeom);
  
  Appearance ap = new Appearance();
  ColoringAttributes ca = new ColoringAttributes(Constants.TEXT_COLOR, ColoringAttributes.NICEST);
  textShape.setAppearance(ap);
  textShape.setPickable(false);
  tg.addChild(textShape);
  
   tg.addChild(billboard);
  return tg;
  }
 

Reply via email to