Hi Shock,
multiple cameras are not ready in the actual version, but may come in the next one.
Alternative, you could create two render images and position the only camera you have, to the positions you want have your two cameras every frame.
After positioning the camera you render the scene to the images.
Also I think multiple cameras are done in this way in DBpro or similar.
hope you understand.
I could make a demo if you want.
[/Edit]
Ok I made it anyway:
Multiple Cameras Demo
// Project: Multiple Cameras by janbo
// Created: 2015-07-02
// set window properties
SetWindowTitle( "Multiple Cameras" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
// Create the datatypes and camera array
type Vec3
X#
Y#
Z#
endtype
type CameraData
Position as Vec3
Angle as Vec3
ViewWidth as integer
ViewHeight as Integer
ImageID
SpriteID
endtype
global Camera as CameraData[]
// call some camrea functions as showcase
LeftTopCameraID=CreateCamera(512,512,0,0)
RightTopCameraID=CreateCamera(512,512,512,0)
LeftBotCameraID=CreateCamera(512,256,0,512)
RightBotCameraID=CreateCamera(512,256,512,512)
SetCameraPos(LeftTopCameraID,0,0,-10)
SetCameraPos(RightTopCameraID,0,2,-10)
SetCameraPos(LeftBotCameraID,0,-2,-10)
SetCameraPos(RightBotCameraID,2,0,-10)
BoxID=CreateObjectBox(2,2,2)
// main loop
do
Print( ScreenFPS() )
i#=i#+50*getframetime()
SetCameraPos(LeftTopCameraID,0,0,-10+sin(i#)*4)
SetCameraPos(RightTopCameraID,0,sin(i#+90)*4,-10)
SetCameraAng(LeftBotCameraID,0,0,i#)
SetCameraAng(RightBotCameraID,0,i#,0)
UpdateCameras()
loop
// Camera Functions
function UpdateCameras()
for CameraID=0 to Camera.length
SetCameraPosition(1,Camera[CameraID].Position.X#,Camera[CameraID].Position.Y#,Camera[CameraID].Position.Z#)
SetCameraRotation(1,Camera[CameraID].Angle.X#,Camera[CameraID].Angle.Y#,Camera[CameraID].Angle.Z#)
SetCameraAspect(1,512/512)
print(Camera[CameraID].Position.X#)
print(Camera[CameraID].Position.Y#)
print(Camera[CameraID].Position.Z#)
Update3D(0)
SetRenderToImage(Camera[CameraID].ImageID,0)
ClearScreen()
Render3D()
next CameraID
SetRenderToScreen()
Update2D(0)
ClearScreen()
Render2DBack()
ClearDepthBuffer()
Render2DFront()
Swap()
endfunction
function CreateCamera(ViewSizeX#,ViewSizeY#,ViewPositionX#,ViewPositionY#)
tempCamera as CameraData
tempCamera.ViewWidth=GetNextPowerOfTwo(ViewSizeX#)
tempCamera.ViewHeight=GetNextPowerOfTwo(ViewSizeY#)
tempCamera.ImageID=CreateRenderImage(tempCamera.ViewWidth,tempCamera.ViewHeight,0,0)
tempCamera.SpriteID=CreateSprite(tempCamera.ImageID)
SetSpriteSize(tempCamera.SpriteID,ViewSizeX#,ViewSizeY#)
SetSpritePosition(tempCamera.SpriteID,ViewPositionX#,ViewPositionY#)
Camera.insert(tempCamera)
endfunction Camera.length
function SetCameraPos(CameraID,PositionX#,PositionY#,PositionZ#)
Camera[CameraID].Position.X#=PositionX#
Camera[CameraID].Position.Y#=PositionY#
Camera[CameraID].Position.Z#=PositionZ#
endfunction
function SetCameraAng(CameraID,AngleX#,AngleY#,AngleZ#)
Camera[CameraID].Angle.X#=AngleX#
Camera[CameraID].Angle.Y#=AngleY#
Camera[CameraID].Angle.Z#=AngleZ#
endfunction
function GetNextPowerOfTwo(Size)
local p
p=1
repeat
p=p*2
until p>=Size
endfunction p
[Edit]