Advertisement

bouncing

Started by April 27, 2002 05:00 AM
0 comments, last by okouya 22 years, 9 months ago
how to bounce with wall i mean by that reflecting velocity if you want not sliding if you have a sample of code or a tuto love and peace
love and peace
Here''s something simple: if you have the normal of the plane of your wall, then you can simply reverse the component of the speed that is parallel to that normal:

(all variables are vectors)
v'': final speed

v'' = v + Dot(N, v) * -N * k

where k is a coefficient of elasticity (or restitution) between 0 and 1. Dot is the dot product (or scalar product) of N and v.

You can find more complicated stuff, but this should be decent.

Cédric

This topic is closed to new replies.

Advertisement