Rem Project: physx1 Rem Created: 9/9/2006 9:03:56 PM Rem ***** Main Source File ***** load image "grass2.bmp",4 load image "stratat.bmp",3 make object terrain 1 set terrain heightmap 1,"stratah.bmp" set terrain split 1,16 set terrain scale 1,12.0,1.2,12.0 set terrain texture 1,3,4 set terrain tiling 1,1 set terrain light 1,0,0,0,1,1,1,1 build terrain 1 phy start `phy set gravity 0.0,-19.6,0.0 `phy set default sleep linear velocity squared 400.0 `phy set bounce threshold 0.0 `phy set auto fixed timing phy make material 2,"Rubber" phy set material dynamic friction 2,0.2 phy set material static friction 2,0.2 phy set material restitution 2,0.2 phy build material 2 phy make rigid body static terrain 1,2 make object sphere 2,1 position object 2,3000,350,1000 phy make rigid body dynamic sphere 2,2 position camera 0,3100,400,1100 `phy set timing 50.0,8,1 phy set rigid body linear velocity 2,-110.0,81.99,100.0 `phy set rigid body angular momentum 2,0.0,10000.0,0.0 phy set rigid body mass 2,1.0 set shadow shading on 2,0,100,1 `phy set rigid body sleep linear velocity 2,500.0 `phy set rigid body linear damping 1,0.0 `phy set rigid body linear damping 2,0.0 do x#=phy get rigid body linear velocity x (2) y#=phy get rigid body linear velocity y (2) z#=phy get rigid body linear velocity z (2) if x#<128.0 then x#=x#+0.01 `phy set rigid body linear velocity 2,x#,y#,z# if controlkey() then phy set rigid body angular velocity 2,100.0,0.0,0.0 `control camera using arrowkeys 0,2,2 point camera 0,object position x(2),object position y(2),object position z(2) position camera 0,camera position x(0),object position y(2)+50,camera position z(0) set camera to follow 0,object position x(2),object position y(2),object position z(2),90,50,5,50.0,1 phy update update terrain sync loop