[java] User Interface painted in 2D overlapping the 3d world

Started by
2 comments, last by AbelCorver 16 years, 1 month ago
Hello everyone! I'm creating a graphical user interface for a 3d game I'm developing. I want to draw the GUI translucent on the 3d world, but in 2D (not 3D). This means that the GUI is not part of the 3d world. Should I use the glasspane, jME? I created a panel/box (in the 3d world) right in front of the view and I try to render the content of a JPanel to a BufferedImage and than set that image as a texture for the box I created previously. This will be a problem for mouse events etc. There has to be an easier way!! Thanks in advance!
Advertisement
Quote:There has to be an easier way!!


Yes, by not involving Swing at all.

3D UIs are in general rendered fully using 3D API, events are handled manually, but monitoring the mouse cursor and clicks, something you need to do anyway.

Doesn't jME provide something like that already?
Quote:Original post by Antheus
Quote:There has to be an easier way!!

Doesn't jME provide something like that already?

Without knowing the answer to that right offhand, it does have pretty simple support for an orthographic projection, which, OP, is the usual way of drawing something 2D on top of your "3D world." You'll have to determine how best to handle clicks and such, but use setOrtho to draw your GUI's elements at the end of each frame. Don't forget to unsetOrtho, too.
So I should use jMonkeyEngine??

This topic is closed to new replies.

Advertisement