; Physics shapes example (an ArcBasic extension) ; A table made of five boxes, and a ball that rolls under it. D shows the shapes Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,4,-9 TurnEntity camera,20,0,0 light=CreateLight() RotateEntity light,50,30,0 ground=CreatePlane() EntityColor ground,80,120,80 EntityPhysics ground,1 ; the table is a pivot with a top and four legs as children, for looks... table=CreatePivot() top=CreateCube(table) : ScaleEntity top,2,.1,1 : PositionEntity top,0,2,0 For x=-1 To 1 Step 2 For z=-1 To 1 Step 2 leg=CreateCube(table) : ScaleEntity leg,.1,1,.1 : PositionEntity leg,x*1.8,1,z*.8 Next Next EntityColor top,160,110,60 PositionEntity table,0,3,0 TurnEntity table,0,20,8 ; ...and one body built from five boxes, so there is room underneath EntityPhysics table,2,5 EntityShape table,1,4,.2,2,0,2,0 For x=-1 To 1 Step 2 For z=-1 To 1 Step 2 AddEntityShape table,1,.2,2,.2,x*1.8,1,z*.8 Next Next ball=CreateSphere(12) ScaleEntity ball,.4,.4,.4 PositionEntity ball,-6,.4,0 EntityColor ball,250,200,60 EntityPhysics ball,2 debug=False While Not KeyHit(1) If KeyHit(57) Then SetEntityVelocity ball,6,0,0 If KeyHit(32) debug=Not debug PhysicsDebug debug EndIf UpdateWorld RenderWorld Text 0,0,"Space: roll the ball D: show the physics shapes" Flip Wend End