Multiple cameras are supposed to work even if they are not consecutively numbered (there was a time when they had to be consecutively numbered from 1 with camera 0 being the default camera but I understand that is no longer the case).
The following code fails on both my machines unless the indicated line is uncommented. In other words if you want, for example, to use a camera 7 then camera 6 must exist even if it isn't used.
If you press <space> to exit the program then a copy of the ghostCamera image is saved. A typical erroneous output image is included in the attached zip file.
set display mode desktop width(), desktop height(), 32
sync on : sync rate 60 : sync
autocam off
position camera 0, 0, -300
point camera 0, 0, 0
color backdrop rgb(0,0,0)
ghostCamera = 11 ` any camera greater than 1 fails unless the next line is uncommented
`if ghostCamera > 1 then make camera ghostCamera - 1 ` crude fix - ghostCamera will not work correctly without this
make camera ghostCamera ` the ghost camera
set camera to image ghostCamera, 8, 512, 512
position camera ghostCamera, 0, 0, -300
point camera ghostCamera, 0, 0, 0
color backdrop ghostCamera, rgb(0,0,0)
make object plain 8, desktop width(), desktop height() ` the ghost object
scale object 8, 60, 80, 100
position object 8, 0, 0, 250
ghost object on 8, 0
lock object on 8
texture object 8, 8
make object cube 2, 100 ` a scene object
position object 2, 0, 0, 0
create bitmap 1, 2, 2
cls rgb(128, 0, 0)
get image 2, 0, 0, 2, 2, 1
texture object 2, 2
set object light 2, 0
set current bitmap 0
delete bitmap 1
repeat
yrotate object 2, object angle y(2)+0.2
show object 2
hide object 8
sync mask 2^ghostCamera ` ghost camera
sync
show object 8
sync mask 2^0 ` main screen camera
sync
until spacekey()
save image "ghost.png", 8
end
Edit I should have explained that you should see a large red cube ghosted on the smaller red one. Without the crude fix described in the code you may see either only the smaller red cube or a very strange image ghosted on it. The exact symptoms vary from machine to machine.