single site with cross hairs.
Rem Created: 12/02/2009 23:25:09
Rem ***** Main Source File *****
sync on
sync rate 60
autocam off
rem make cross hairs
create bitmap 1,100,100
cls rgb(255,255,255)
ink rgb(0,0,0),0
rem left to center
line 3,50,45,50
rem right to center
line 55,50,96,50
rem botom to center
line 50,55,50,96
get image 10,0,0,100,100,1
rem set screen output 0
set current bitmap 0
make matrix 1,100,100,25,25
position matrix 1,-50,-1,-50
rem right eye
make camera 1
position camera 1,0,3,-15
`point camera 0,0,0,0
make_object_disc(1,5.0,.1)
set camera to image 1,1,100,100
position object 1,0,3,15
texture object 1,1
rotate object 1,90,0,0
fix object pivot 1
lock object on 1
set object mask 1,1
`rem left eye
`make camera 2
`position camera 2,0,3,-15
`point camera 0,0,0,0
`make_object_disc(2,5.0,.1)
`set camera to image 2,2,100,100
`position object 2,-2.5,3,15
`texture object 2,2
`rotate object 2,90,0,0
`fix object pivot 2
`lock object on 2
`set object mask 2,1
fov#=61.9621391296
`set image colorkey 0,0,0
make object cube 10,3
position object 10,0,0,10
make object plain 3,5,5,1
texture object 3,10
position object 3,0,2.7,14
SET OBJECT TRANSPARENCY 3,1
ghost object on 3,5
lock object on 3
set object mask 3,1
do
rotate camera 1,camera angle x(0),camera angle y(0),camera angle z(0)
position camera 1,camera position x (0),camera position y(0),camera position z(0)
move camera 1, 15
` rotate camera 2,camera angle x(0),camera angle y(0),camera angle z(0)
` position camera 2,camera position x (0),camera position y(0),camera position z(0)
` move camera 2, 15
center text screen width()/2,0,"binoculars with Zoom. arrowkeys to move camera < > to zoom"
if inkey$()=","
inc fov#,.5
if fov#>100.0 then fov#=100.0
endif
if inkey$()="."
dec fov#,.5
if fov#<1.0 then fov#=1.0
endif SET CAMERA FOV 1,fov#
`SET CAMERA FOV 2,fov#
control camera using arrowkeys 0,.1,.5
sync
loop
function make_object_disc(id,radius as float height as float)
if height>radius then EXIT PROMPT "Height larger than radius","Height Error":end
local mesh mesh2
mesh = 100000
mesh2 = 100001
rem make a square table
`make object plain id, radius,height
make object box id,radius,height,radius
rem cut out disc
make object cylinder id+1,-radius
make mesh from object mesh,id+1
rem save the mesh file
if file exist("testmesh.x")=1 then delete file "testmesh.x"
save mesh "testmesh.x",mesh
rem delete the object
delete object id+1
rem reload the object
Load mesh "testmesh.x",mesh
rem mke the new object with mesh
make object id+1,mesh,0
rem do the CSG
PERFORM CSG DIFFERENCE id,id+1
rem delete +1 object
delete object id+1
rem make mesh from new object
make mesh from object mesh2,id
rem save the mesh file
if file exist("testmesh2.x")=1 then delete file "testmesh2.x"
save mesh "testmesh2.x",mesh2
rem delte the object to load load a new object mesh
delete object id
rem load the mesh
load mesh "testmesh2.x",mesh2
rem make the new object
make object id,mesh2,0
endfunction
Dark Physics makes any hot drink go cold.