We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Convex Collision, correcting bugs
Page Index Toggle Pages: 1
Convex Collision, correcting bugs (Read 1281 times)
Convex Collision, correcting bugs
Oct 5th, 2005, 11:43am
 
I made a little sketch for showing Convex Collisions, but the balls seem to be able to escape..
http://wliia.org/projects/convexCollision/

any help would be appreciated..

-seltar
Re: Convex Collision, correcting bugs
Reply #1 - Oct 5th, 2005, 2:14pm
 
To be honest I didn't wade through your code but programmed something like this recently where this issue came up. I left it in as for my thing I liked the aesthetic effect this caused.

for my project it was whare the polygon was being updated close to a object would bounce off it. It meant that effectively the update moved the polygon over the areas that would cause a bounce.

This was as the procedure meant that it would evaluate at one frame and not cross a boundary and so not cause a bounce. Then it would update the polygon and the position of the object and see if the vector between the old position and the new position crossed any polygon lines, if so it would then bounce the object. The issues comes up when the movement of the polygon was greater then the vector that the object would move.

I guess there are a few ways that you could correct your code, for instance if an object moves from inside the polygon to outside you then place the object on the polygon at the point ware it's movement vector would intersect the polygon. Or just inside. Then re-do the bounce caulations to give it it's new velocity vector.

I hope this helps.
Re: Convex Collision, correcting bugs
Reply #2 - Oct 7th, 2005, 3:36am
 
I don't know if you could take something from this: Polygon intersection.
***
Source.
Page Index Toggle Pages: 1