How to render a HUD/texture with no zoom?

How do you Xith users draw HUD stuff (for example) on top of your 3d scene, so that the HUD textures aren’t being zoomed/scaled on screen?
So each pixel of the texture (called texel I think?) is mapped to one pixel on screen.
With direct OpenGL it works, I read in the Newless Clubies forum. But how to do in Xith3d?

How does com.xith3d.userinterface draw its textures?
It looks like it doesn’t use Parallel_Projection but keeps the view’s transformation, then “corrects” it in some way I don’t understand however, and render its textured Shape3Ds.
The com.xith3d.scenegraph.view class calls com.xith3d.userinterface.UIWindowManager.newFrame(Transform3D viewTransform) and then I’m lost…

Hi

Here is the code to my HUD-Class
I think it would be a solution for your problem



public class HeadsUpDisplay extends UIWindow {
    
    public HeadsUpDisplay(int width, int height) {
        super(piWidth, piHeight, false, true);
        setRoot(makeGUI());
    }
    
    public JComponent makeGUI() {
        JPanel oJPanel = new JPanel(true);
        oJPanel.setDoubleBuffered(true);
        oJPanel.setSize(new Dimension(getWidth(), getHeight()));
        oJPanel.setLocation(0, 0);
        oJPanel.setBackground(Color.darkGray);
        oJPanel.setLayout(null);
        oJPanel.setOpaque(false);
        // Here you add some swing stuff to your panel
        return oJPanel;
    }
    
}


To add it to your view:


UIWindowManager oUIWindowManager = new UIWindowManager(canvas3D);
HeadsUpDisplay oHeadsUpDisplay = new HeadsUpDisplay(width, height);
oUIWindowManager.addOverlay(oHeadsUpDisplay);
oUIWindowManager.setPosition(oHeadsUpDisplay, 0, 0);
oUIWindowManager.setVisible(oHeadsUpDisplay, true); 

This would make it for you.

[quote]Here is the code to my HUD-Class
I think it would be a solution for your problem
[/quote]
Thanks for your answer. I’m going to use your code when I’ll draw Swing related GUI things and plain HUD textures with Xith (which I’ve not done so far).
However what I’ve been mainly interested in is how Xith does do it internally. Because I intend to draw a pure 2d scene with a 3d binding/engine, so just planar textured quads. I think using Xith’s UI is massive overkill in such a case… :slight_smile: