I am trying to "fly" a ship over a track with a small hill in Wipeout style. But for some reason the ship either flys THROUGH the hill or just stops at it.
Could someone take a look at my code and tell me if there is an obvious mistake as I have only been at Blitz3D for 2 days and I really am struggling with this collision lark :(
The code is a bit of rehash from the driver example as well as one of the sample programs that shows how to load an object. I really would appreicate any help on this as this is really annoying me at the moment to the point I want to kick the computer in (not a good idea I know!!! :-D)
Thanks
Max
If you want the files it loads they should be here!
Could someone take a look at my code and tell me if there is an obvious mistake as I have only been at Blitz3D for 2 days and I really am struggling with this collision lark :(
The code is a bit of rehash from the driver example as well as one of the sample programs that shows how to load an object. I really would appreicate any help on this as this is really annoying me at the moment to the point I want to kick the computer in (not a good idea I know!!! :-D)
Thanks
Max
; Racer Test Program V1.1 ; April 2005 ; This program is a rehash of two program to try and get a ship to fly around ; a pre-made track. Graphics3D 800,600,16,2 SetBuffer BackBuffer() ; Setup contants and varibles as used in the driver example and modified for what I think I need. Const GRAVITY#=-.01 Const BODY=1,WALL=2,RACETRACK=3 Collisions BODY,RACETRACK,2,2 Collisions BODY,WALL,2,1 ; Load required Track & Walls and set them up as needed. This includes linking to any variables. track=LoadMesh ("Media/TestTrack2a.3ds") walls=LoadMesh ("Media/TestTrack2b.3ds") PositionEntity track,0,0,0 PositionEntity walls,0,0,0 RotateEntity track,0,0,-90 RotateEntity walls,0,0,-90 EntityType track,RACETRACK EntityType walls,WALL ; Now do the same for the ship (this replaces the car in the driver example). ship=LoadMesh ("Media/fighter.3ds") PositionEntity ship,0,0,0 EntityShininess ship,1 EntityType ship,BODY ; Set up a pivot point for the ship now. Hopefully this will poisition the pivot under the ship ; and will enable the ship to "float" over the track in Wipeout style. target=CreatePivot(ship) PositionEntity target,0,-5,0 ; Set up the main light for the scene. light=CreateLight() PositionEntity (light,0,10,-10) ; Now get the camera up and running... camera=CreateCamera() CameraRange camera,1,100000 CameraFogMode camera,1 CameraFogRange camera,2000,90000 PositionEntity camera,0,500,1500 PointEntity camera,ship ; Setup other variables camx#=0 ; Camera X Angle. camy#=0 ; Camera Y Angle. camz#=0 ; Camera Z Angle. pitch#=0 ; Camera & Ship Rotation Angle. While Not KeyHit(1) ;move ship If KeyDown(203) camy=camy+3 TurnEntity ship,0,3,0 EndIf If KeyDown(205) camy=camy-3 TurnEntity ship,0,-3,0 EndIf If KeyDown(200) MoveEntity ship,0,0,-800 EndIf ; Reset camera position and view. PositionEntity camera,EntityX(ship),EntityY(ship),EntityZ(ship) RotateEntity camera,0,camy,pitch MoveEntity camera,0,500,1500 PointEntity camera,ship UpdateWorld RenderWorld Text 320,500,"Racer Demo V1.1" Flip Wend End
If you want the files it loads they should be here!