Loading...
Logo
Processing Forum
Hey Andres and Jean-Pierre,

I am at the final stages of a sketch and the part that I thought would be easiest is turning out to be really difficult (as usual!)

I have implemented a 3D scene using GLGraphics and Proscene.

Now I would like to draw 2D text and some graphics in a heads-up display style - so it appears on top of the 3D scene and does not respond to camera movement.

I can get proscene's screenDrawing function to work, but only for shapes drawn vertex-by-vertex (so text() does not work).

I have tried using GLGraphicsOffScreen and overlaying, but the objects drawn to that screen buffer respond identically to camera movement -- I want them to disregard all camera movement, and I can't figure out how to do that.

Any suggestions for achieving this goal of a HUD?

Thanks very much,
Jacob

Replies(6)

Hi,
(sorry in my delay getting back to you, but I just got your message)

As for the text the function textMode(SCREEN) should do the trick. Call it in your setup() and then call text("My text", myXScreenCoord, myYScreenCoord) at the end of your draw() function.

Hope that helps,

 -jp
Hey Jean-Pierre,

Thanks so much for getting back! That works -- but my fps drops massively (from ~30 to ~3fps).

Any other thoughts?

xJ
Hi, I modified the ScreenDrawing example that comes with Proscene so it uses the GLGraphics renderer, but I haven't noticed any drop in the fps. Not so sure what might be the cause in your case.

Try to come up with a simple sketch that reproduces the problem and post here, that would make easier to figure what is wrong.
or perhaps it simply has to do with the fact that: " textMode(SCREEN) with OPENGL and JAVA2D (the default) renderers will generally be slower, though pixel accurate with P2D and P3D "? See it  here. Any plans to improve this for the upcoming Processing 2.0 release? Or does anyone know another workaround?

 -jp
SCREEN mode is actually gone from the new P3D in Processing 2.0.
Update to earlier post:
The slowness of the textMode(SCREEN) mode is due to Processing - not due to Proscene. I tried it with Peasycam and it has exactly the same problem. So I tried another suggestion made by Jean-Pierre (see  https://forum.processing.org/topic/proscene-and-2d-drawing) and it worked beautifully for me.

Jean-Pierre: thank you for a wonderful library!!!!