December 9, 2009, 11:27pm
i have a little Problem with my HUD.
Everything works well, except sometimes my HUD hides behind another Object, like in the Screenshot, although the HUD is rendered in Ortho-Mode.
Here is some Code how i create my HUD:
Quad dataBg = new Quad("hud", 236f, 100f);
bs is just some BlendState and this.attachChild(dataBg); attaches the quad to a node, that is attached to the rootNode. So it's not directly attached to the rootNode. Is this a mistake?
Do you have an Idea what I'm doing wrong?
December 9, 2009, 11:33pm
This has to do with the minimum z-depth that the camera displays. I think you can avoid it by setting the setFrustumNear() value of the camera. I had this problem as well and dug into that a bit, its about camera settings, that much I can say for sure
December 14, 2009, 9:20pm
Thanks for your help.
I solved this Problem with replacing this line:
with this one:
But now I got another Problem.
I'm currently trying to add a Weapon to the HUD.
So i got this model:
As u can see, the model looks right, but if I add this to the HUD and set RenderQueue to Ortho it looks like this:
And here is the Code how i add the Weapon to the HUD:
URL ninjaUrl = new File("player/paintballGun.jme").toURI().toURL();
Node weapon = ModelCache.getInstance().getModel(ninjaUrl);
Quaternion rot = new Quaternion();
rot.fromAngleAxis(FastMath.DEG_TO_RAD * 90, Vector3f.UNIT_Y);
Game.getGame().getDisplay().getWidth()/2 + 250,
ModelCache.getInstance().getModel(ninjaUrl); just returns a Node with the Model in it.
What am i doing wrong?