setRenderQueueMode [solved]

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?

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();
}

Thanks sbook, but it doesn't work. The quad stay behind spatial node.  :?

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));

You are right Creativ, thank you! :slight_smile: