type model
filename as String
id as integer
posX as float
posY as float
posZ as float
endtype
SetWindowTitle( "Arcade kart physics - Tech demo" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
SetVirtualResolution( 1024, 768 ) // Display properties
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps
LoadScene()
//obj=LoadObject("track.obj")
//SetObjectScale(obj,5,5,5)
//RotateObjectLocalY(obj,90)
SetCameraPosition(1,-13,13,-15)
//SetCameraLookAt(1,0,0,0,0)
do
if GetRawKeyState ( 37 )
MoveCameraLocalX(1,-1)
endif
if GetRawKeyState ( 39 )
MoveCameraLocalX(1,1)
endif
if GetRawKeyState ( 40 )
MoveCameraLocalY(1,-1)
endif
if GetRawKeyState ( 38 )
MoveCameraLocalY(1,1)
endif
print (GetCameraX(1))
print (GetCameraY(1))
sync()
loop
function LoadScene()
file = OpenToRead("track.layout")
line as string
model as model
do
line = ReadLine(file)
if FileEOF(file) = 1
exit
endif
if mid(line, 1, 1) = "#"
continue
endif
model.filename = GetStringToken2( line, " ", 1 )
model.posX = ValFloat(GetStringToken2( line, " ", 2 ))
model.posY = ValFloat(GetStringToken2( line, " ", 3 ))
model.posZ = ValFloat(GetStringToken2( line, " ", 4 ))
model.id=LoadObject(model.filename)
SetObjectRotation(model.id,0,90,90)
SetObjectScale(model.id,12,12,12)
SetObjectPosition(model.id,model.posX,model.posY-5,model.posZ)
loop
endfunction
track.Layout
track1.obj 1.02531 -1.4732 1.28575
track2.obj 1.02502 -1.2419 1.28299
track3.obj 1.02541 -1.0093 1.28824
track4.obj 1.28415 -0.8352 1.28415
track5.obj 1.02656 -0.6621 1.28790
track6.obj 1.02550 -1.4730 1.11031
track7.obj 1.02595 -0.9975 1.11125
track8.obj 1.02509 -0.6631 1.11276
track9.obj 1.02661 -1.4765 .93491
track10.obj 1.02650 -1.2989 .93940
track11.obj 1.02602 -0.9979 .93817
track12.obj .81989 -0.5267 .74339
track13.obj 1.02671 -0.4910 .94058
track14.obj 1.02608 -1.3008 .76652
track15.obj 1.02400 -1.1270 .76697
track16.obj 1.07507 -0.6808 .78017
track17.obj .81989 -0.3901 .60703
track18.obj 1.02653 -1.3042 .59215
track19.obj 1.02507 -1.1269 .59407
track20.obj 1.02622 -0.9805 .59376
track21.obj 1.02509 -0.8389 .59423
track22.obj 1.02535 -0.6650 .59501
track23.obj 1.02586 -0.4907 .59187
track24.obj 1.02656 -0.3157 .59706
track25.obj 1.06448 -0.6803 .44321
track26.obj 1.02627 -0.3167 .42205
track27.obj 1.02656 -0.6660 .24622
track28.obj 1.02507 -0.4907 .4907
track29.obj 1.02656 -0.3152 .24790
track30.obj .97690 -0.9966 .82740
http://users.tpg.com.au/subarpk/test2.rarfubar