Re: Including text in a 3D Display.

Hi Carlos,

> I did what you told me, but im not able to visualize any text in the
> display.
> 
> I´ll include the code I´ve written.
> 
> Here is where I define my 3D display:
>         GraphicsConfiguration gConfig= VisADCanvasJ3D.getDefaultConfig();
> 
>         DisplayRendererJ3D renderer= new DefaultDisplayRendererJ3D();
> 
>         WriteText3D write3D= new WriteText3D(renderer, gConfig);
> 
>         DisplayImplJ3D display3D= new DisplayImplJ3D("display3D", renderer,
> DisplayImplJ3D.JPANEL, gConfig, write3D);
> 
> The Write Text3D class is the one that extends from VisADCanvasJ3D:
> 
>         public class WriteText3D extends VisADCanvasJ3D {
> 
>             private String titleText;
> 
>             public WriteText3D( DisplayRendererJ3D renderer,
> GraphicsConfiguration config) {
> 
>                     super(renderer,config);
> 
>                     titleText="Prueba de texto fijo";
> 
>             }
> 
>             public void renderField(int i) {
> 
>                     J3DGraphics2D g2D= this.getGraphics2D();
> 
>                     g2D.drawString(titleText,100,80);
> 
>                     super.renderField(i);

Add this statement here:

                      g2D.flush(false);

>             }
> 
> }

Good luck,
Bill


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: