Here's a slightly simpler example of what I suggested:
sync on
sync rate 60
rem Create some test images to texture the skybox' sides with
CreateTestTexture(1, 0xff0000ff, "North")
CreateTestTexture(2, 0xffff0000, "West")
CreateTestTexture(3, 0xffffff00, "South")
CreateTestTexture(4, 0xff00ff00, "East")
CreateTestTexture(5, 0xff800080, "Bottom")
CreateTestTexture(6, 0xff0080ff, "Top")
rem Create a skybox of size (1000x1000) using object ID '1' as well as (temporarily) making use of mesh '1'.
MakeSkybox(1, 1, 1000, 1000, 1, 2, 3, 4, 5, 6)
rem Position the skybox and camera at (0, 0, 0)
position object 1, 0, 0, 0 rem The skybox is just a normal object
position camera 0, 0, 0
while not escapekey()
mmx = mouseMoveX()
mmy = mouseMoveY()
mmz = mouseMoveZ()
rotate camera wrapvalue(camera angle x() + (mmy * 0.31)), wrapvalue(camera angle y() + (mmx * 0.31)), 0.0
move camera mmz
rem Keep the camera within the 1000x1000 unit skybox
if (camera position x() ^ 2 + camera position y() ^ 2 + camera position z() ^ 2) >= 250000.0 then move camera -mmz
sync
endwhile
end
function MakeSkybox(obj as dword, mesh as dword, width as float, height as float, texN as dword, texW as dword, texS as dword, texE as dword, texB as dword, texU as dword)
rem Make base object
make object plain obj, width, height, 1
rem Create a mesh from the base object so that we may duplicate it 5 more times to create the limbs
make mesh from object mesh, obj
rem Attach the mesh to our base object and offset + rotate it to create the sides (the north side is the base limb (0)):
offset limb obj, 0, 0, 0, width / 2.0
texture object obj, texN
rem West side
add limb obj, 1, mesh
rotate limb obj, 1, 0, 270, 0
offset limb obj, 1, -width / 2.0, 0, 0
texture limb obj, 1, texW
rem South side
add limb obj, 2, mesh
rotate limb obj, 2, 0, 180, 0
offset limb obj, 2, 0, 0, -width / 2.0
texture limb obj, 2, texS
rem East side
add limb obj, 3, mesh
rotate limb obj, 3, 0, 90, 0
offset limb obj, 3, width / 2.0, 0, 0
texture limb obj, 3, texE
rem Bottom side
add limb obj, 4, mesh
rotate limb obj, 4, 90, 0, 0
offset limb obj, 4, 0, -height / 2.0, 0
texture limb obj, 4, texB
rem Upper side
add limb obj, 5, mesh
rotate limb obj, 5, 270, 0, 0
offset limb obj, 5, 0, height / 2.0, 0
texture limb obj, 5, texU
rem Remove the mesh as we won't need it any longer
delete mesh mesh
rem We usually don't want (vertex) lighting on our skybox since it has such a low polygon count.
rem Essentially this would just make certain sides appear darker than the others, thus making for quite visible seams.
set object diffuse obj, 0xffffffff
set object ambient obj, 0
endfunction
function CreateTestTexture(img as dword, bgcol as dword, label as string)
for bmp = 31 to 1 step -1
if not bitmap exist(bmp)
create bitmap bmp, 128, 128
set current bitmap bmp
box 0, 0, 127, 127, bgcol, bgcol, bgcol, bgcol
ink 0xffffffff, 0
center text 128, 128, label
get image img, 0, 0, 127, 127
set current bitmap 0
delete bitmap bmp
exitfunction img
endif
next bmp
endfunction 0
Speed would hardly be an issue since creating a skybox like this is relatively fast and is only to be done once at startup anyway.
"Why do programmers get Halloween and Christmas mixed up?" Because Oct(31) = Dec(25)