I have cut out everything except for this part of the project, the rest is not used:
CreateSphere() is from the samples.
Init3d()
END
TYPE OBJECT // The 3D objects
obj // Object ID
x; y; z // Position
dx; dy; dz // delta for movement
rx; ry; rz // rotation
ENDTYPE
FUNCTION Init3d:
LOCAL cam AS OBJECT
// Load textures
gfx.brick1 = DynLoadSprite("texture/brick1.png")
gfx.concrete1 = DynLoadSprite("texture/concrete1.png")
gfx.concrete2 = DynLoadSprite("texture/concrete2.png")
gfx.concrete3 = DynLoadSprite("texture/concrete3.png")
gfx.concrete4 = DynLoadSprite("texture/concrete4.png")
gfx.concrete_purple = DynLoadSprite("texture/concrete_purple.png")
gfx.cracks = DynLoadSprite("texture/cracks.png")
gfx.diagonal = DynLoadSprite("texture/diagonal.png")
gfx.sand = DynLoadSprite("texture/sand.png")
gfx.sunrise = DynLoadSprite("texture/sunrise2.png")
gfx.white = DynLoadSprite("texture/white.png")
RESTORE cameras
FOR n = 0 TO 4
READ cam.x, cam.y, cam.z
READ cam.rx, cam.ry, cam.rz
cam.obj = EntityCreateCamera()
EntitySetCameraRange(cam.obj, 1, MAX_RANGE)
EntitySetPosition(cam.obj, cam.x, cam.y, cam.z)
EntitySetRotation(cam.obj, cam.rx, cam.ry, cam.rz)
DIMPUSH camera[], cam // Add the camera to the array of cams
DEBUG "obj:"+camera[n].obj+"\n"
NEXT
active_cam = 4 // The last added camera is the active camera
light = EntityCreateLight(RGB(255,255,255))
EntityMove(light, -150, 150, 150)
// Skybox (or ball in this case)
CreateSphere(0, 2, 35, RGB(255,255,255))
ENDFUNCTION
//! Load sprites. Animations and sprites seems to share ID's
FUNCTION DynLoadSprite: file$
LOCAL free_texture
free_texture = EntityGetFreeTexture()
LOADSPRITE file$, free_texture
RETURN free_texture
ENDFUNCTION