how to make a "jump" in 3D ?

Blitz3D Forums/Blitz3D Beginners Area/how to make a "jump" in 3D ?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is one way to jump in 3D.
(Fast editing of one of the examples that comes with BB3D)

; Jump and collision
; Einar Wedoe
; Based on the example by Paul Gerfen

Graphics3D 800,600,16,2

Const CUBE_COL=1
Const SPHERE_COL=2
Global vel#=0

SetBuffer BackBuffer()

camera=CreateCamera()
CameraViewport camera,0,0,800,600
PositionEntity camera,0,0,-5

light=CreateLight()

cube=CreateCube()
PositionEntity cube,0,-5,5
EntityColor cube,70,80,190
EntityType cube,CUBE_COL

sphere=CreateSphere(12)
PositionEntity sphere,0,3,5
EntityColor sphere,170,80,90
EntityType sphere,SPHERE_COL

Collisions SPHERE_COL,CUBE_COL,3,1

While Not KeyHit(1)

vel=vel-0.01
MoveEntity sphere,0,vel,0

UpdateWorld
RenderWorld

If EntityCollided(sphere,CUBE_COL) Then vel=.4
									
If KeyDown(203) Then TurnEntity camera,0,0,2
If KeyDown(205) Then TurnEntity camera,0,0,-2

TurnEntity cube,0,1,0
TurnEntity sphere,0,-2,0

Flip
Wend

End