Angle based bounce

Blitz3D Forums/Blitz3D Programming/Angle based bounce

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.

if your walls are 'straight' you can use this,

with xi,yi,zi being the current inertia of the ball when it hits.

nx=collidedNx()
ny=collidedny()
nz=collidedNz() ;get the normals

if nx<>0 xi=-xi
if ny<>0 yi=-yi
if nz<>0 zi=-zi
;-

you could try nx=abs(collidednX())*x etc, for non straight angles.