Jump to content
  • Advertisement
Sign in to follow this  
muimui1911

[Urgent]collision detection algorithm

This topic is 4778 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody, I am makeing a interior design simulation program, which i draw the floor plan in 3D, then open and insert 3D furnitures(3ds) into the program and be able to move them, other than that it is a stereographic program where i have to use mouse and keyboard control to walk in the 3D environment but. Program is build under Win32 application with openGL using C++ 6.0. My Difficulties: -I must not walk through the wall, -the 3D furniture i insert in must not collide with the wall, -can't get the open files menu pop out, in other word i can't choose which to import -be able to move the furniture after i insert in 1. For anyone who know collision detection in detail, Would you please suggest what collision method should i use? (since the FloorPlan (a flat) has like 5 rooms, using simple bounding box seems make it much more difficult) 2. If i use bounding box for the wall, then can i apply other algorithms for the furnitures, e.g. OBB, AABB? or should i use bounding box(but furnitures should be able to move around so the coordinates will varies...) 3. is bounding box method only apply on static objects? Millions of thanks, [Edited by - muimui1911 on August 27, 2005 4:56:01 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
1. For anyone who know collision detection in detail,
Would you please suggest what collision method should i use?
I think you could get a good collision detection system up and running for this, even without a lot of experience in the subject. One question, though. How accurate does it need to be? More specifically, is it ok if, say, a chair that you are moving stops even if it's not quite touching another object? Or do want exact results?

Also, how complex are your furniture objects? Are they rectinilear, or do they have curves? And how are they represented? Are they arbitrary meshes imported from a modeling program?

I'd be glad to offer some suggestions on this, but I'd need a little more info to make a recommendation.

Share this post


Link to post
Share on other sites
Probably best to use a simple axis aligned bounding box method to do your collision detection if you are new to it, rather than a per-poly or more complicated method.

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
One question, though. How accurate does it need to be? More specifically, is it ok if, say, a chair that you are moving stops even if it's not quite touching another object? Or do want exact results?

Also, how complex are your furniture objects? Are they rectinilear, or do they have curves? And how are they represented? Are they arbitrary meshes imported from a modeling program?

I'd be glad to offer some suggestions on this, but I'd need a little more info to make a recommendation.


Thanks for your kindness, the reason i ask what collision method to use is because, for example if i use "bounding Box" say for a chair, then i wanna put things onto the chair, then using "bounding box" will cause the THING Levitate in the air. it is the same if it apply on a large cupboard.

The accuracy should not be too rough, here is the criteria:
1. I should not walk through the wall
2. I should collide with objects when i walk near them
3. Objects should collide with objects when i import the object in.
4. Imported objects should collide with the wall, where the wall is simiply drawn by openGL but import objects drawn by 3Dmax.
5. When detected collision, it should have some real time response in virtual environment. i.e gravity, force.(this may be too far since i haven't done the detect collision yet)
6 To choose the best methods between OBB(oriented bounding box), AABB......
7. This is my university term project(Final year Project) and i am just thinking too simple methods may not show what i have learnt :-P coz i need to write a report explaining the theory about it.


Thankyou very much ~!!
millions of thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dude, you haven´t been paying too much attention to your classes, have you?

Share this post


Link to post
Share on other sites
Quote:
The accuracy should not be too rough, here is the criteria:
1. I should not walk through the wall
2. I should collide with objects when i walk near them
3. Objects should collide with objects when i import the object in.
4. Imported objects should collide with the wall, where the wall is simiply drawn by openGL but import objects drawn by 3Dmax.
5. When detected collision, it should have some real time response in virtual environment. i.e gravity, force.(this may be too far since i haven't done the detect collision yet)
6 To choose the best methods between OBB(oriented bounding box), AABB......
7. This is my university term project(Final year Project) and i am just thinking too simple methods may not show what i have learnt :-P coz i need to write a report explaining the theory about it.
Well, that actually sounds fairly complicated. Keeping your camera from colliding with the environment is quite manageable, but I'm not sure what to tell you about inter-object collisions. It sounds like you just have arbitrary meshes imported from a modeler. Detecting intersections between such objects would probably require a general mesh intersection algorithm. And then there's the issue of finding a suitable penetration vector...

It's the being able to set something on a chair part that makes it difficult, I think. Otherwise, you could probably use oriented bounding boxes and static tests with the separating axis theorem and get good results. There may be some other solution that I'm not thinking of at the moment, but otherwise it seems you'll have to a) implement general mesh collision detection, or b) decompose your objects into convex primitives, or c) scale back your design a little.

Share this post


Link to post
Share on other sites
Only way then is per-polygon collision but don't expect it to work real-time if you do want such accurate collision. I'd advise you to break the objects up into manageable component OBBs though if you need real time graphics, which probably means writing your own model format and OBB editor tool to store them... A lot of work either way.

Btw, what's gamedev.net's stance on helping people with their homework?

Share this post


Link to post
Share on other sites
Quote:
Original post by Leo_E_49
Btw, what's gamedev.net's stance on helping people with their homework?


In general you're not supposed to, but in this case I think it's OK because he's not asking anyone to solve his problem or write his code for him, but only to point him in the right direction to some good algorithms.

EDIT: I in no way speak authoratatively on this, however...

[Edited by - nilkn on August 27, 2005 11:32:10 AM]

Share this post


Link to post
Share on other sites
Ok thanks, I was just wondering. Well, I'd suggest if you want that level of accuracy, look at the triangle collision algorithm found in Game Programming Gems p390, the article on 3D Collision Detection.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!