Login  Register

Re: Text Rendering to JOGL2

Posted by tami on Dec 31, 2011; 1:53am
URL: https://forum.jogamp.org/Text-Rendering-to-JOGL2-tp3617263p3622290.html

Hi Wade,

Initially, before porting to JOGL2, I happily used this sort of thing to render text:

    public void initTextRenderer() {
        Font font = new Font("SansSerif", Font.BOLD, 14);
        textRenderer = new TextRenderer(font, true, false) {};
    }
...
                        textRenderer.begin3DRendering();
                        textRenderer.draw3D(pps, 0, 0, 0, 0.007f);
                        textRenderer.drawString3D(gl, null, pps, xrot, VW, VW);
                        textRenderer.end3DRendering();
                        
It was great.  Now, it looks like that doesn't work anymore.  So, I've been trying to figure out what will work.

> TestAWTTextRendererUseVertexArrayBug464.java example listed by Sven above seems to work fine for me (I just pasted the code verbatim into a file, fixed an import, and ran it).  Are you running the above example, or something else of your own devising? 

I was actually trying to work with Sven's other exampe:  http://jausoft.com/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java;hb=HEAD#l151

I know I'm a little clueless here, so I do apologize for needing help.  My idea was that if I added your classes (GPURendererListenerBase01, GPUTextGLListener0A, and GPUTextRendererListenerBase01) to my project, that I should be able to somehow call/use GPUTextRendererListenerBase01 to render to a canvas.  I can get everything to compile, but I really don't know how to implement that GPUTextRendererListenerBase01 class.  I tried this sort of thing:

canvas6.addGLEventListener(new GPUTextRendererListenerBase01(null,1,false,false) {});

... but that's what's giving me the NPE.

I'm just having a really hard time believing it is this hard to just put text at a point in 3d space on a glcanvas.

Am I going in the totally wrong direction?  I must be!!

>Also, it might help if you listed your platform and graphics card. 
Mac OS X 10.6.8
Intel HD Graphics 3000
Java SE 6 1.6.0_29-b11-402
And I got the libraries I'm using from:  http://jogamp.org/deployment/jogamp-current/archive/

I truly appreciate any help at all.  This stuff has gotten very complex!

Thanks,
Tami


On Fri, Dec 30, 2011 at 6:21 PM, Wade Walker [via jogamp] <[hidden email]> wrote:
Hi Tami,

I just verified on my system (Win 7 64-bit) that the TestAWTTextRendererUseVertexArrayBug464.java example listed by Sven above seems to work fine for me (I just pasted the code verbatim into a file, fixed an import, and ran it). Are you running the above example, or something else of your own devising? Also, it might help if you listed your platform and graphics card.



If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Text-Rendering-to-JOGL2-tp3617263p3622097.html
To unsubscribe from Text Rendering to JOGL2, click here.
NAML