Physics How To

Blitz3D Forums/Blitz3D Userlibs/Physics How To

Jerome Squalor(Posted 2008) [#1]
so how would someone go about making a physics engine?


Abrexxes(Posted 2008) [#2]
Graphics 512,512,0,2
SetBuffer BackBuffer()

xp#=100
yp#=100
xg#=0
yg#=0


While Not KeyHit(1)

   mx=MouseX()
   my=MouseY()

   ;Richtungsvektor an Geschwindigkeit anlegen
   xg=xg+(mx-xp)/100.0
   yg=yg+(my-yp)/100.0

   ;Ein einfacher Luftwiederstandersatz
   xg=xg*.98
   yg=yg*.98

   ;Geschwindigkeit an Position anwenden
   xp=xp+xg
   yp=yp+yg

   Color 255,0,0:Line mx,my,xp,yp
   Color 255,255,0:Oval xp-4,yp-4,9,9,1
   Color 255,255,255:Rect mx-4,my-4,9,9,0

   Flip
   Cls
Wend
End


Just a beginning ;)


Jerome Squalor(Posted 2008) [#3]
coolio...


Jerome Squalor(Posted 2008) [#4]
hey, just made it so the ball bounces off the walls




Abrexxes(Posted 2008) [#5]
Cool, here another one. First draw some lines with the left mouse button, then push 2 times ESC. (i have lots of this little codes that i found all the time in the forums ^^)




Jerome Squalor(Posted 2008) [#6]
cool, thanx


mtnhome3d(Posted 2008) [#7]
heres a great physics example i found here