How to Calculate CameraZoom for 1:1 pixels

Blitz3D Forums/Blitz3D Programming/How to Calculate CameraZoom for 1:1 pixels

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

If you want some of the basic technical theory, these tips might help:

The camera, by default, has a zoom value of 1.0, which gives it a 90 degree field of view horizontally. This might be a little wide for full 3D stuff, but it's a fairly handy level of zoom to deal with for this sort of thing.

With a 90 degree field of view, an object that's one unit wide placed centered but one unit away from the camera will take up exactly the full width of the frame.

So if you have an object that's 640 units wide and 480 units tall, placed at 0, 0, 640 relative to the camera, it should have that 1:1 ratio you're looking for.

If you're keeping all your objects and sprites at the same distance away from the camera, remember that using EntityOrder() can be used to override the Z-buffer and tell the rendering engine what goes on top of what.