After falling trap to too many misunderstandings with that, here’s my best effort at a writeup how Lemur handles coordinates.
Corrections, gross misunderstanding cleanup etc. vastly appreciated. (This is mostly towards @pspeed.)
I phrased this as a Javadoc for Panel so it can be patched in if it happens to be correct.
[java]/**
A GUI element.
<p>
Its local translation determines the position of its top-left corner.<br>
Its visible area extends to the right (positive X coordinates) and down
(negative Y coordinates).<br>
The layout code for {@code Panel}s assume that rotation and scale are at
You’re welcome
… anyway, doing what I can to give where I received.
On the choice of coordinate system: I think it’s the best approach to seamlessly mix GUI components and scenegraph elements. I see some situations where that can help, e.g. when displaying equipment models inside the GUI, or when displaying a GUI on an in-game panel. Of course that’s always possible, but I think it’s conceptually easier by a lot if the GUI simply uses the same coordinate system.
Oh. You don’t want to (ab)use the Z coordinate if the GUI is on an in-game object, since players can then look at it from an angle and the Z order becomes visible. So you’ll want to sort explicitly. (Not an immediate concern to me anyway, just something to look out for if I ever place a Lemur display inside a scenegraph.)
<cite>@toolforger said:</cite>
You're welcome :-)
... anyway, doing what I can to give where I received.
On the choice of coordinate system: I think it’s the best approach to seamlessly mix GUI components and scenegraph elements. I see some situations where that can help, e.g. when displaying equipment models inside the GUI, or when displaying a GUI on an in-game panel. Of course that’s always possible, but I think it’s conceptually easier by a lot if the GUI simply uses the same coordinate system.
Oh. You don’t want to (ab)use the Z coordinate if the GUI is on an in-game object, since players can then look at it from an angle and the Z order becomes visible. So you’ll want to sort explicitly. (Not an immediate concern to me anyway, just something to look out for if I ever place a Lemur display inside a scenegraph.)
Lemur elements need not be “flat”… so in a real 3D scene then I’d expect objects to be solid/3d things. In Mythruna, I have flat pages that move around but the camera angle is relatively fixed so that you don’t see the layering if you look at it edge-on.
Sorting can already be done explicitly with the “layer” user data but it won’t fix z-buffer issues… so things still need to be offset slightly not to z-fight.
Edit: and note… for the crafting “mini games” that I will add later, those will be real 3D objects in 3D space. It’s nice that I can keep using the same UI classes, though.