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);
}
}
That´s all. Thanks again for all of your help!!
----- Original Message -----
From: "Bill Hibbard" <hibbard@xxxxxxxxxxxxxxxxx>
To: "Carlos Pleguezuelos" <carlos.pleguezuelos@xxxxxxxxxxxxxx>
Sent: Monday, December 30, 2002 2:37 PM
Subject: Re: Including text in a 3D Display.
Hi Carlos,
There is an answer to your question at:
http://www.unidata.ucar.edu/cgi-bin/msgout?/glimpse/visad-list/3371
Good luck,
Bill
> I have a question about how to include some text in a display. I have a
DisplayImplJ3D contained in a Swing Component, a JFrame. I wanna
> include a title text in the upper left corner of the display, but I dont
want this text to move around when I zoom in or out the display, or
> when I move it. The text should be "frozen" and be in the same place all
the time. I wanna something like the "Vis5D" logo that appears when
> you visualize some data through Vis5D. How can i do it?
>
> I´m able to put some text into the display, but when I move the "cube" It
moves too!!
>
> Thanks for all of your help.
--
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706
hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html