Setting a Quad Width/Height to Pixels?

Hello all.

Is it at all possible to set a Quad’s width and height to pixel values, and let jME figure out the rest? I have a series of 2D sprites (BillboardNodes) which I want to keep at the same z index and have display at their texture’s natural width/height.

Thanks for any help!

If you’r drawing in ortho the values given will be in pixels. You might be looking for com.jme.gui.UIBillboard.

Thanks Per, I’ll look into UIBillboard.

What does “drawing in ortho” mean? Sorry, I am very new to this. :slight_smile:

Orthographic Projection, as opposed to Perspective Projection. Basically, if you have a shape that is 5 unit across it will take up five units on the screen no matter how far it is from the camera. This is the mode you typically render UIs in (as well as doing CAD work).

I see, many thanks! I know what to do when I start looking at my GUI now. :wink: But this clues me into something that I probably can’t do with UIBillboard…

I’d like to offer a “zoom” feature, which would zoom into the 3D ground file (no trouble there) but also zoom into sprites as well. So, while I want to define my Quad in terms of pixels, I want that to be an initial value. Is that possible with either BillboardNode or UIBillboard?

Alternatively, I don’t have any problem defining something in Perpective Projection – as long as I can somehow size the Quad so that it is the natural pixel size. So far I’ve just tried simply dividing the width/height values of the texture image by a number to reduce the size, but this is messy and inaccurate.

Thanks again for all the help everyone!