Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690