In 3D the screen resolution is pretty meaningless when it come to the position of objects and the camera. The aspect ratio is more important as it could mean objects go of the edges of the screen.
Here is a simple example of fives cards (planes) laid out and how to position and orientate the camera.
screen_width = 400
screen_height = 240
SetVirtualResolution(screen_width,screen_height)
SetWindowSize(screen_width,screen_height,0)
// create five cards and place then down left to right, symmetrical about the 0,0,0
for i = 1 to 5
CreateObjectPlane(i,20,40)
SetObjectRotation(i,90,0,0)
setObjectPosition(i,(i-3)*25,0,0)
next i
// using a directional light just makes the object look nicer
CreateLightDirectional(1,0,-1,0,255,255,255)
// you need to set the camera to a position that means all the cards appear on the screen
SetCameraPosition(1,0,100,-80)
// if the cards are symmetrical about 0,0,0 then you can point the camera at 0,0,0
SetCameraLookAt(1,0,0,0,0)
do
sync()
loop
If you change the screen_width value to 480, then cards on the extreme left and right go off the screen.
If you have the half both the width and height, you get a lower resolution (and in this case smaller window) but all the cards are clearly visible.
If you're feeling really fancy, you can use the mouse to pick the cards.
screen_width = 800
screen_height = 480
SetVirtualResolution(screen_width,screen_height)
SetWindowSize(screen_width,screen_height,0)
// create five cards and place then down left to right, symmetrical about the 0,0,0
for i = 1 to 5
CreateObjectPlane(i,20,40)
SetObjectRotation(i,90,0,0)
setObjectPosition(i,(i-3)*25,0,0)
next i
// using a directional light just makes the object look nicer
CreateLightDirectional(1,0,-1,0,255,255,255)
// you need to set the camera to a position that means all the cards appear on the screen
SetCameraPosition(1,0,100,-80)
// if the cards are symmetrical about 0,0,0 then you can point the camera at 0,0,0
SetCameraLookAt(1,0,0,0,0)
do
// colour all the cards white
for i = 1 to 5
SetObjectColor(i,255,255,255,255)
next i
// the rest of this code shows to pick a 3D object using the mouse
// get pointer coordinates
pointer_x = GetPointerX()
pointer_y = GetPointerY()
// get a unit vector into the screen based on the pointer coordinates
unit_x# = Get3DVectorXFromScreen(pointer_x,pointer_y)
unit_y# = Get3DVectorYFromScreen(pointer_x,pointer_y)
unit_z# = Get3DVectorZFromScreen(pointer_x,pointer_y)
// determine the start of the ray cast based, take the unit vectors and add the camera position
start_x# = unit_x# + 0
start_y# = unit_y# + 100
start_z# = unit_z# - 80
// determine the end of the rat cast, take the unit vertor and multiply by the length of the ray cast then add the camera position
end_x# = 1000*unit_x# + 0
end_y# = 1000*unit_y# + 100
end_z# = 1000*unit_z# - 80
// determine if a card has been hit by the ray cast
object_hit = ObjectRayCast(0,start_x#,start_y#,start_z#,end_x#,end_y#,end_z#)
// if an card has been hit then turn it red
if object_hit <> 0
SetObjectColor(object_hit, 255,0,0,255)
endif
sync()
loop