|
akademiks
|
 |
« on: February 01, 2012, 10:20:35 AM » |
|
Hi guys, I work on a small CAD application where all 3d objects are simple 3D convex polygons. I want to set a mode in the app where objects cannot traverse each others. Since no real physic is implicated i basically just need to call a simple collision(obj1,obj2) function. I found a good lib called PGP ( http://gamma.cs.unc.edu/SSV/) but i just found that the license is for non profit application which is not my case...
|
|
|
|
|
Logged
|
|
|
|
|
EdgeOfProphecy
|
 |
« Reply #1 on: February 01, 2012, 10:26:33 AM » |
|
A few questions.
1) How fast can objects move? 2) How many objects need to be moving a the same time? 3) How precise does the collision and math need to be? 4) You said this is for a CAD program? How would code be integrated into the project? I'm guessing you have access to the source, but what language is it in?
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #2 on: February 01, 2012, 10:29:40 AM » |
|
1 - Well i am not sure about how fast, i guess not that much since the speed is driven my the finger dragging. 2 - Either 1 or a ground of N objects all moving as a group 3 - It must be really accurate (support 3d convex polygons with rotations). There is also the fact that the application has an orthographic view mode. 4 - I am looking for a C/C++ code library, ideally with source available because its an iOS project so i don't want to waste hours trying to compile the thing ...
Thx
|
|
|
|
« Last Edit: February 01, 2012, 10:36:35 AM by akademiks »
|
Logged
|
|
|
|
|
EdgeOfProphecy
|
 |
« Reply #3 on: February 01, 2012, 10:31:15 AM » |
|
Is it for smartphones?
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #4 on: February 01, 2012, 10:36:52 AM » |
|
Yes, see my updated answer above
|
|
|
|
|
Logged
|
|
|
|
|
ThemsAllTook
|
 |
« Reply #5 on: February 01, 2012, 10:56:34 AM » |
|
I'm not an expert, but I played with Newton a while back and came away with a good impression of it. At a glance, it looks like it might fit what you need.
|
|
|
|
|
Logged
|
|
|
|
|
EdgeOfProphecy
|
 |
« Reply #6 on: February 01, 2012, 10:58:34 AM » |
|
Hmmmm, normally I'd recommend Box2D, but that's...well...2D, which won't cut it. I think Bullet has a version for iOS. It's an open source physics engine, and I've heard pretty good things about it. I don't know what it would actually be like running on iOS, though. I know it's a full on physics engine, and you're looking for just collision, but it might be scalable to your needs. Other than Bullet, the only thing I've heard of is a detection library called coldet, but I know basically nothing about it. http://sourceforge.net/projects/coldet/http://bulletphysics.org/wordpress/
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #7 on: February 01, 2012, 11:07:58 AM » |
|
Thanks for the suggestions, i will have a look at them.
For Bullet, yes its easy to include in an iOS project i did it before but like you said its a whole physic engine where you have to setup a physic world object and update it at each step etc...
|
|
|
|
|
Logged
|
|
|
|
|
BorisTheBrave
|
 |
« Reply #8 on: February 01, 2012, 03:08:51 PM » |
|
If you just have convex polytopes, then GJK is what you want. It's not that difficult to implement, but Bullet has an implementation. If you need to support arbitrary meshes, it gets much harder. I would recommend either decomposing, or just doing an "approximate" method. Such as checking every vertex for being inside the other shape - this will work in 90% of cases.
|
|
|
|
|
Logged
|
|
|
|
Ivan
Owl Country
Level 10
alright, let's see what we can see
|
 |
« Reply #9 on: February 02, 2012, 01:57:34 AM » |
|
For Bullet, you don't need to setup a physics world if you only want collisions, it has a simpler, collision-only world.
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #10 on: February 02, 2012, 04:47:29 AM » |
|
Really? Could you give me more info about that?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Geti
|
 |
« Reply #12 on: February 02, 2012, 05:00:37 PM » |
|
If you've got all your mesh data there it could be simple enough to just write code determining if any of the edges of one shape intersect any of the faces of the others. Its not like you need distances of penetration or whatever -> a simple catch all like that would likely suit your needs. Depends if you've got the time to implement it or not, but I expect integrating a large library like bullet would probably take a similar amount of time.
|
|
|
|
|
Logged
|
|
|
|
|