The docs say that SetCameraOrthoWidth with default of 40 will cause a cube of 40 units to fill the screen. As you can see in the example below, this is not the case. The cube only fills half the width. If you count the spheres placed at 1 until intervals, you will see that the screen is actually 80 units wide. To have the cube fill the screen, you need to set a width of 20.
// Project: OrthoWidthProblem
// Created: 2018-04-10
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "OrthoWidthProblem" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetCameraFOV(1,0)
SetCameraOrthoWidth(1,40)
for x = -40 to 40
for y = -40 to 40
o = CreateObjectSphere(.5,5,5)
SetObjectPosition(o,x,y,0)
next
next
setcameraposition(1,0,0,-100)
SetCameraRotation(1,0,0,0)
createobjectbox(40,40,40)
do
Sync()
loop