Drawing in the Graphics object

Hi,

I have some 2D code which I would like to use on top of my 3D stuff. Basically, I’m drawing curves in 3D and in the bottom left corner of the graph I would like to have something like a legend.

I know that rewriting the legend code in jogl is probably the best thing to do. But is there in temporary solution in which I could draw my legend directly to Canvas3D.getGraphics().

What’s happening right now is that the 2D object appears momentarily and gets immediately overdrawn.

Many thanks in advance.

Pahidla

It may be due to Graphics drawing to the front buffer and
your 3D rendering is drawing to the back buffer, and when
SwapBuffers() is called, your Graphics’ output disappears.

Is there a fix?

Perhaps you can draw to an image and use it as a texture?

[quote]Perhaps you can draw to an image and use it as a texture?
[/quote]
I totally agree with this method, render a QUAD with a texture containing your 2D stuff