jme1133
1
Hi ppl, I have a question about: Renderer.QUEUE_ORTHO.
I have this from Our first HUD example, but the quad from this code is not always on the first plane of cam.
private void LoadQuad()
{
hudNode = new Node("hudNode");
Quad hudQuad = new Quad("hud", 150f, 150f);
hudQuad.setRenderQueueMode(Renderer.QUEUE_ORTHO);
hudQuad.setLocalTranslation(new Vector3f(display.getWidth()/2,display.getHeight()/2,0));
hudQuad.setLightCombineMode(Spatial.LightCombineMode.Off);
hudQuad.updateRenderState();
hudNode.attachChild(hudQuad);
rootNode.attachChild(hudNode);
}
Any tip?
sbook
2
Try attaching the quad to the node before changing its settings:
private void LoadQuad()
{
hudNode = new Node("hudNode");
Quad hudQuad = new Quad("hud", 150f, 150f);
hudNode.attachChild(hudQuad);
rootNode.attachChild(hudNode);
hudQuad.setRenderQueueMode(Renderer.QUEUE_ORTHO);
hudQuad.setLocalTranslation(new Vector3f(display.getWidth()/2,display.getHeight()/2,0));
hudQuad.setLightCombineMode(Spatial.LightCombineMode.Off);
hudQuad.updateRenderState();
}
jme1133
3
Thanks sbook, but it doesn't work. The quad stay behind spatial node. :?
Creativ
4
Hi,
i had the same Problem and i think changing the z-value of the localTranslation solved it.
Try something like this:
hudQuad.setLocalTranslation(new Vector3f(display.getWidth()/2,display.getHeight()/2,1));
jme1133
5
You are right Creativ, thank you! 