So when we first added Z elevation the Z axis was originally normalised such that at 100% zoom the camera is at a Z position of 100, looking down at the Z=0 plane (i.e. 100 units away). This kind of made sense for Z elevation to make it simple to use no matter the view size. However with the added 3D features I think it's actually become a bit of a complication. We might need to add a setting that lets you change this to something that uses equal units on all axes for 3D.
To work out the math you just need to think about the camera on a side-view, and use trigonometry:
If you split the view in half, notice the top triangle has an angle of fov / 2
, and the opposite side of the triangle has length viewH / 2
. Currently Construct calculates z
to be 100 and scales the view to fit that, using a fixed FOV of 45 degrees. But instead you can calculate what z
ought to be given the angle and opposite length. With trigonometry we know tan(a) = opposite / adjacent
, which in this case is tan(fov/2) = (viewH / 2) / z
. Rearranging to solve for z
, we get z = (viewH / 2) / tan(fov/2)
. If I open the 3D shape example and use the view height there of 480, this gives z = 240 / tan(22.5) = 579.4
(approx). Since we know Construct calculated z
to be 100, this gives a Z scale factor of ~5.8 to match Z units to X/Y pixels. So one of the 3D boxes is 100x100; to make it a cube its Z height should be 100 / 5.8 = 17.2 (approx).
So if I set the cube to a Z height of 17.2 and set up a 3D camera looking at it, bingo, it looks like a cube with the same size on every axis:
The default of 14 was just a guess from eyeballing it, but is a bit too short. Your guess of about 5:1 was close, it's 5.8 in this case, but as you can see it depends on the viewport height of the project.
With a new camera setting to match all the axes, you'd be able to just set the 3D shape to 100x100 with a Z height of 100, and it'd look cube. Although I'd add the details of these calculations may change in future, such as if we add a configurable FOV.