Jump to content

  • Log In with Google      Sign In   
  • Create Account


2D polygon collision detection and rigid body dyna


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
43 replies to this topic

#1 0BZEN   Crossbones+   -  Reputation: 2013

Posted 18 June 2004 - 11:04 AM

hey chums, I'm currently writing a 2D collision and rigid body demo and tutorial, you can download the demos, code, docs here http://uk.geocities.com/olivier_rebellion/Polycolly.zip or http://uk.geocities.com/olivier_rebellion/ "2D swept+overlap polygonal collision and response" what it does... - 2D swept and overlapped convex polygon collision detection. - local-space collision tests. - exact contact point calculations. - 2D rigid body dynamics, with friction and restitution and all. - segment-polygon intersections (for modelling bullets and other particles). it starts from relatively simple (separation axis method for overlap detection), and builds up to the rigid body dynamics. I will extend the docs to give a complete overview of the code. It should make its way to jnrdev when no_skill will have time. In the meanwhile, I'm still in the process of completing the doc, which stops at collision detection and basic arcade physics. I'm also thinking of implementing joints later on. have fun!

Sponsor:

#2 Asheh   Members   -  Reputation: 352

Posted 19 June 2004 - 10:03 AM

Excellent demos :) You have alot of docs on it too, Ill probably read through them when I come to the physics in my 2d engine.
Regards.
Ash.

#3 owl   Banned   -  Reputation: 364

Posted 19 June 2004 - 11:37 AM

Thank you olii for sharing.

You deserve a higher rating for your constant contributions on collision detection methods to the community!

#4 Woodsman   Members   -  Reputation: 426

Posted 19 June 2004 - 11:38 AM

Quote:
Original post by owl
Thank you olii for sharing.

You deserve a higher rating for your constant contributions on collision detection methods to the community!

Agreed. The post you made when you initially presented this in a thread on the for beginners forum helped me a lot.

#5 0BZEN   Crossbones+   -  Reputation: 2013

Posted 20 June 2004 - 08:58 PM

I've updated the docs, and finally agreed on a structure for them :)

All docs will now be written in HTML directly (word6 HTML, mind you).

...I'll use this thread to keep you guys up to date with the progress.

#6 bpj1138   Members   -  Reputation: 113

Posted 21 June 2004 - 11:30 AM

what about contact forces?


#7 0BZEN   Crossbones+   -  Reputation: 2013

Posted 21 June 2004 - 09:37 PM

what contact forces? :) I'm thinking of using a penalty method, by inserting a spring between two objects that overlap at the contact points. 'But', I really want to do this right in the long term, so I'm considering other methods, like constraint based. At the moment, I'm just pushing the objects apart, which is fine but will brake in extreme cases (massive objects standing on small light objects, high gravity, ...).

I'm also thinking of iterative methods to resolve contacts, but I've got to think about it.

#8 jack_1313   Members   -  Reputation: 536

Posted 22 June 2004 - 11:59 AM

Another great tutorial… easy to read, easy to understand and although I am yet to put the code into action I imagine, judging by the demos provided, that it is very effective.
Are you planning to extend and explain how one might handle rotating objects (as seen in the demos)? I imagine that might prove quite useful.
On a side note, a friend of mine downloaded the demos only to find that they did not run correctly. Apparently the first program (bin folder) works fine, but in the other two the polygons move about shrinking to nothing and then re-growing. Any ideas on that one?
The only criticism I hold is that, within the articles, your sentences sometimes begin with capital letters and other times do not. It doesn’t exactly matter anyhow.

Jackson Allan


#9 bpj1138   Members   -  Reputation: 113

Posted 22 June 2004 - 12:42 PM

Oli,

Let me give you some advice. You seem to post a lot of info here for free, and it's your right to do so, but consider who's reading your articles. One, people who are competing with you in the game development business (you are in this for profit, correct?) And two, people that have no business writing games, because they're not good at it. This has negative effects in the community. It creates a lot of noise which makes it harder for legitimate developers to get noticed. It floods the market with poor quality games which in turn makes the consumers reluctant to try more independent games. So I ask you to reconsider your position. You have talent, that's great, but don't give the answers to the jocks and retards, it's really not helping.

--Bart


#10 leiavoia   Members   -  Reputation: 960

Posted 22 June 2004 - 05:55 PM

Quote:
Original post by bpj1138
Oli,

Let me give you some advice. You seem to post a lot of info here for free, and it's your right to do so, but consider who's reading your articles. One, people who are competing with you in the game development business (you are in this for profit, correct?) And two, people that have no business writing games, because they're not good at it. This has negative effects in the community. It creates a lot of noise which makes it harder for legitimate developers to get noticed. It floods the market with poor quality games which in turn makes the consumers reluctant to try more independent games. So I ask you to reconsider your position. You have talent, that's great, but don't give the answers to the jocks and retards, it's really not helping.

--Bart


I'll just go ahead and strongly disagree. I appreciate Oliii's advice and insights. I consider myself neither jock nor retard. I'm not an idiot or newbie, but I don't work professionally. I feel that if you have something good to share, you should share it. I plan to write some tutorials soon myself, since i feel that A) it teaches those with less knowledge, and B) gives the real pros a chance to rip you to pieces, thereby teaching you.

If you are developing games for profit, your game will shine on it's own if you create it good enough. If it fails, it's not because of all the other games out there. The good ones do get noticed. The cream rises to the top. If it doesn't, it probably wasn't good enough.



[Edited by - leiavoia on June 23, 2004 12:55:08 AM]

#11 jack_1313   Members   -  Reputation: 536

Posted 22 June 2004 - 08:02 PM

Quote:
Original post by bpj1138
Oli,

Let me give you some advice. You seem to post a lot of info here for free, and it's your right to do so, but consider who's reading your articles. One, people who are competing with you in the game development business (you are in this for profit, correct?) And two, people that have no business writing games, because they're not good at it. This has negative effects in the community. It creates a lot of noise which makes it harder for legitimate developers to get noticed. It floods the market with poor quality games which in turn makes the consumers reluctant to try more independent games. So I ask you to reconsider your position. You have talent, that's great, but don't give the answers to the jocks and retards, it's really not helping.

--Bart


I am not a professional game developer. Does this mean I am a ‘retard’ who does not own the right to make games? I might just dumb the community down a little in my efforts?
To class the people on these forums as either professional developers or those who have no business in game development because ‘they are not good enough’ seems a little absurd. As far as I am concerned anyone who wishes it should has the right to create games – am I allowed to play basketball with a group of friends even though we might not be basketball pros? Or would that be defacing the sport and discouraging spectators? We should be encouraging independent game development, not knocking people back because they might be new and do not have a degree in computer science. The more people interested in game programming the better – it only means we have a larger community, more games to play and more talent to rise before us. I ask you – how does one become an independent developer without beginning at some place? How does one learn if all resources are blockaded? I myself am a hobbyist programmer (of several years) with a completed game behind me. Am I not good enough to continue creating games that others will enjoy because I am inexperienced in the department of rigid body dynamics?
I do not mean offence, and I hope none is taken. I do not wish to start an argument, and I can see the reasoning behind your opinion. I am merely challenging this view of which seems, to me, so illogical.

Jackson Allan

#12 Airo   Members   -  Reputation: 191

Posted 22 June 2004 - 08:26 PM

Very nice oliii!

I'm working on contact forces in a lcp way and it's not getting somewhere so if you do that for me (grin). For me it's a lot of work. I think a penalty method is easier/faster to implement but you seem to have a lot of time :)

Looking forward to see more.

#13 0BZEN   Crossbones+   -  Reputation: 2013

Posted 23 June 2004 - 08:52 AM

Quote:
Original post by bpj1138
Oli,

Let me give you some advice. You seem to post a lot of info here for free, and it's your right to do so, but consider who's reading your articles.
--Bart


na, I don't agree. :) See, when I started, and even now, I found the web, forums, tutorials invaluable. Basically, I'm slowly paying back my debt to the community. I am 100% for free and sharing.

I don't own my brain, the company I work for does. I do work in the game industry, but what I'm posting is hardly top secret, so they don't mind. It's advanced-beginner, not exactly ground-breaking, but useful. I could probably, with a lot of effort, make a commercial library in the long term, if only I cared, but first, this is also a learning exeprience, and sharing the code, basically open source, help me improve it bit by bit. So it's not a one way process, I get help and insights as well.

Call me a hopeless leftie, but I don't see it as a money opportunity. :)

about the syntax, format, punctuation, well, I plan on correcting the tutorial once I've got everything in there. The HTML format isn't great either. I'll probably have to use another HTML editor. I've cleaned the code for the first tutorials, and it's coming along nicely.

Next is the rotation stuff, I probably won't explain matrices in great depths, like I didn't write anything about vectors, and just point to some articles on the web. Explaining vectors, matrices, cartesian coordinate systems, trigonometry, polar coordinate systems, seems a bit beyond the scope.

Then rigid bodies, although I'm tempted to just point to Chris Hecker's tutorials, since it's nothing more than an implementation of his stuff.

thanks for the feedback anyway ;)

#14 0BZEN   Crossbones+   -  Reputation: 2013

Posted 23 June 2004 - 12:41 PM

oupsy. While doing a major cleanup on the code, I found a major bug in the dynamic collision test. conceptual bug. in short, it's not working :)

actually, it is now :) I just mis-read Dave Eberly's doc on OBB-OBB collision detection. Now it's fixed. The demos has been updated, but not the doc, which will change a bit. Most of the stuff is correct, except the calculation of the time of collision (you have to take the MAXIMUM time, not the minimum), and you also have to test the vector perpendicular to the relative displacement (or velocity) as well as the usual separating axes.



#15 0BZEN   Crossbones+   -  Reputation: 2013

Posted 24 June 2004 - 11:47 AM

Just to keep you updated. Demos have been cleaned up, up to tutorial 5. Handling rotations is explained briefly, and two demos are provided for that, since it's an important step towards explaining rigid body dynamics. The rigid body demos still have a few legacy bugs in there, noticeably, the dynamic collision detection, and the inertia calculations.

6 demos are provided, demonstrating the stuff step by step, as explain in the docs. So it's less the anarchy it was once before. :)

#16 SupeyBits   Members   -  Reputation: 109

Posted 26 June 2004 - 05:33 AM

Quote:
Original post by bpj1138
Oli,

Let me give you some advice. You seem to post a lot of info here for free, and it's your right to do so, but consider who's reading your articles. One, people who are competing with you in the game development business (you are in this for profit, correct?) And two, people that have no business writing games, because they're not good at it. This has negative effects in the community. It creates a lot of noise which makes it harder for legitimate developers to get noticed. It floods the market with poor quality games which in turn makes the consumers reluctant to try more independent games. So I ask you to reconsider your position. You have talent, that's great, but don't give the answers to the jocks and retards, it's really not helping.

--Bart


I think ollie has more friends than you.




#17 Hedos   Members   -  Reputation: 674

Posted 26 June 2004 - 04:26 PM

Awesome stuff :)

Thanks a lot

#18 0BZEN   Crossbones+   -  Reputation: 2013

Posted 29 June 2004 - 10:02 PM

another tutorial (number 6), although a short one. How to compute contact points from collision information. Then I can move on to rigid body dynamics. Demo provided.

Also, bug fixes in one of the previous demos.

#19 0BZEN   Crossbones+   -  Reputation: 2013

Posted 02 July 2004 - 09:38 AM

another 2 tutorials. The rigid body tutorial (altough, it mostly poitns to Chris Hecker's physics page), and the segment-polygon test, put into action (you get to shoot things).

That should be all for a while. :)

#20 MindWipe   Members   -  Reputation: 940

Posted 02 July 2004 - 09:22 PM

Yay! Those demos simply rocked. Thanks alot!

/MindWipe




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS