View previous topic :: View next topic |
Author |
Message |
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sun Jan 11, 2009 10:51 am Post subject: space between objects |
|
|
Take a look at this here screenshot:
Do you think it's possible to create a new object that fills the space between the two objects without altering the geometry of the existing objects? It needs to fit in perfectly. I think CSG is needed here, probably in combination with using bounding boxes, but maybe you guys can think of better methods.
If you can think of a method that can be used in DeleD right now, please let me know. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Sun Jan 11, 2009 11:30 am Post subject: |
|
|
Are you looking for an algorithmic way or just for this special case?
If 2:
I'd take a slice of one of those two and scale it wider so it fits the gap completely
then just subtract copies of the two objects from it and I get (optimized, other two objects hidden)
there are some errors left though, you have to delete those faces _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sun Jan 11, 2009 12:34 pm Post subject: |
|
|
I'm looking for a generic algorithm. Indeed, your suggestion works perfectly for this particular case.
Now what if the two objects differ so the ends don't exactly match? A slice of one object doesn't fit on a slice of the other object. How could we solve this case? _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Jan 11, 2009 12:39 pm Post subject: |
|
|
For a more generic algorithm, you'd calculate the convex hull of the total set, then subtract the actual geometry using CSG.
a) This would require CSG routines that are robust to overlapping planes. Otherwise the convex hull can be scaled down slightly, but that would result in slightly mismatching planes where-ever the fill geometry hits the original geometry.
b) It would also create fill geometry for any non-convex parts at the outer tips of those cylinders (if there is any). |
|
Back to top |
|
|
Grandmaster B DeleD PRO user
Joined: 03 Jul 2007 Posts: 218
|
Posted: Sun Jan 11, 2009 2:31 pm Post subject: |
|
|
If you have two convex objects its easy.
1. Find the seperating plane.
2. Take all faces from object 1 that face that plane.
3. Make a copy of the faces.
4. Flip the faces.
5. Extrude the faces to the plane.
6. Repeat step 2 to 5 for object 2.
7. Merge both parts.
For concave objects you must make some kind of visibility test for each face to the plane and do some clipping.
This functionality is called "Bridge" in some 3D apps.
I hope that is what you meant. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sun Jan 11, 2009 3:23 pm Post subject: |
|
|
Grandmaster B: at first glance, I'd say that method works for objects that have simular geometry. What if the geometry of both objects differ greatly? The extruded parts probably wouldn't fit together in that case.
I think Convex Hull is what I was looking for - it seems to me that should do it. I have looked at Convex Hull theory in the past. It's time to get into it again. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
Grandmaster B DeleD PRO user
Joined: 03 Jul 2007 Posts: 218
|
Posted: Sun Jan 11, 2009 3:39 pm Post subject: |
|
|
I see. Convex hull seems to be a better way.
It would also be nice to have a "Generate convex hull" function in DeleD to generated collision meshes for games.
Btw. do objects in DeleD 2 have its own transformation matrix / local space? |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sun Jan 11, 2009 3:55 pm Post subject: |
|
|
I can definately see advantages of convex hulls in DeleD. To be continued!
Internally, each object in DeleD is stored in worldspace and transformed back into object space when 3D manipulations are being done. When the 3D manipulation is done, the object is transformed to worldspace again. When saved to DXS, all you see are worldspace coordinates. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
|