fb:porticula NoPaste
3D - Test
Uploader: | AndT |
Datum/Zeit: | 03.12.2007 23:29:53 |
TYPE XYZPos
x AS DOUBLE
y AS DOUBLE
z AS DOUBLE
END TYPE
TYPE XYPos
X AS DOUBLE
Y AS DOUBLE
END TYPE
DIM AS INTEGER mx,my,sc
DIM AS STRING Taste
DIM AS XYZPos tst
DIM AS XYZPos cam
DIM AS XYZPos tstobj = (.1,.1,.1) ' ObjektParameter
DIM AS XYPos res = (800,600) ' Auflösung
DIM AS XYPos camscal = (res.x*1.50,res.y*1.70) ' Skalierung Maus/Objekt
SUB Viereck(BYVAL ax AS DOUBLE,BYVAL ay AS DOUBLE,BYVAL az AS DOUBLE,BYVAL col AS INTEGER)
LINE (ax,ay)-(ax+az,ay+az),col,bf
END SUB
' 3D
screenres res.x,res.y
cam.y=1
DO
CLS
tst.x=400
tst.y= 300
tst.z=200
SCREENLOCK
locate 1,1
print cam.x
print cam.y
DO
tst.z-=tstobj.z
tst.x+=tstobj.x
tst.y+=tstobj.y
Viereck(tst.x/cam.x*2,tst.y/cam.y*2,tst.z,tst.x MOD 64)
LOOP UNTIL tst.z <0
SCREENUNLOCK
getmouse mx,my,sc
if sc > -1 then
cam.x=camscal.x/mx
cam.y=camscal.y/my
end if
SLEEP 1
LOOP UNTIL MULTIKEY(&h01)