Hi all.
I’ve been using libgdx to experiment with it’s 3D api, and currently have a test program set up as shown in this screenshot:
Pastebin of relevant portions of the code: http://pastebin.com/kvqK609n
It’s drawing 4 planes out using MeshPartBuilder and applying a texture to each. It also uses a PerspectiveCamera to display the scene.
My questions:
-
Why do I need to double the z-axis units to get the correct ‘cube’ shape appearing? As seen in the code, I need to use +2 for the z coordinates whereas x and y are only -1/+1
-
I would like to end up with a scene where the corners of the “floor” and “walls” are stretched into the corners of the viewport, as shown by the red dashed lines. What would be the “correct” way to do this? I’ve tried all sorts of adjustments with the PerspectiveCamera aspect ratio, or manually adjusting the vertex locations of the planes but nothing has seemed to work quite right. I’m not sure if the “wall” and “floor” planes should actually be larger in units that the back plane, or simply visually stretched somehow via the camera.
Thanks in advance for any help!