We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello folks,
I started making my 2D game a 3D game and everything works fine so far, but there is one problem with the HUD. At first I draw all 3D stuff with this settings:
camera(/* settings */);
hint(ENABLE_DEPTH_TEST);
and then I draw the 2D stuff with this settings:
camera();
hint(DISABLE_DEPTH_TEST);
the result looks like this:
as you can see the font is very bloated.
If I drawit without the camera();
option it looks like this:
Very smooth but the HUD lies on the ground somewhere in the middle of the game. Can someone of you help me with this problem?
Answers
I do it like this
maybe this helps:
I can suggest three options:
Take your first solution as a starting point and further tweak it through text settings: textFont, textSize, making sure that created and displayed font size are equal etc.
Use the P2D renderer for the main canvas. Draw your game world in a P3D PGraphics and display it as an image, then draw the 2D HUD elements on top.
Create (another) PGraphics that uses the JAVA2D renderer, draw the 2D HUD elements inside this PGraphics, then display the resulting image in the main canvas.
did you try OPENGL instead of P3D in size() ?
you could also make a version of your program that shows only a sphere and the HUD and post it, so we can take a look
please see also:
http://forum.processing.org/two/discussion/2533/p2d-over-p3d-into-p3d-sketch/p1
In Processing 2+, it's the same as P3D! @-)
it just occured to me that when you use text in the 3D part, the text in the 2D part suddenly looks greasy / no sharp - I dunno why.
just change the text line in the 3D part with //
Thank you all for the quick replys! Everything works now and it even looks smooth. I draw all 3D stuff into a canvas and draw the 2D stuff on top of it. I also had to define serveral fonts for different sizes.
the game looks really cool
can anyone explain why I have that bug?
Is it a processing bug?
When I use text, the rest (the HUD) shouldn't change because of that...