Hiya all,
I trying to get Collisions between with camera and Terrain hills and also how I get player(or the camera) go up the hills.
(CODE)
; Set collision type values
type_ground =1
type_character=2
type_scenery =3
Graphics3D 640,480
SetBuffer BackBuffer()
camera=CreateCamera()
PositionEntity CAMERA,0,200,0
EntityType CAMERA,type_character
light=CreateLight()
RotateEntity light,90,0,0
; Load mesh
terrain=LoadMesh("Maps/TERRAIN.b3d")
PositionEntity terrain,0,0,0
EntityType CAMERA,type_ground
CameraRange camera,1,100000
; Enable collisions between type_character and type_ground
Collisions type_character,type_ground,2,2
While Not KeyDown( 1 )
If KeyDown( 205 )=True Then TurnEntity camera,0,-10,0
If KeyDown( 203 )=True Then TurnEntity camera,0,10,0
If KeyDown( 208 )=True Then MoveEntity camera,0,0,-15
If KeyDown( 200 )=True Then MoveEntity camera,0,0,10
If KeyDown( 57 ) =True Then MoveEntity camera,0,10,0
RenderWorld
UpdateWorld
Flip
Wend
End
(/CODE)
I trying to get Collisions between with camera and Terrain hills and also how I get player(or the camera) go up the hills.
(CODE)
; Set collision type values
type_ground =1
type_character=2
type_scenery =3
Graphics3D 640,480
SetBuffer BackBuffer()
camera=CreateCamera()
PositionEntity CAMERA,0,200,0
EntityType CAMERA,type_character
light=CreateLight()
RotateEntity light,90,0,0
; Load mesh
terrain=LoadMesh("Maps/TERRAIN.b3d")
PositionEntity terrain,0,0,0
EntityType CAMERA,type_ground
CameraRange camera,1,100000
; Enable collisions between type_character and type_ground
Collisions type_character,type_ground,2,2
While Not KeyDown( 1 )
If KeyDown( 205 )=True Then TurnEntity camera,0,-10,0
If KeyDown( 203 )=True Then TurnEntity camera,0,10,0
If KeyDown( 208 )=True Then MoveEntity camera,0,0,-15
If KeyDown( 200 )=True Then MoveEntity camera,0,0,10
If KeyDown( 57 ) =True Then MoveEntity camera,0,10,0
RenderWorld
UpdateWorld
Flip
Wend
End
(/CODE)