Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

space between objects

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Sun Jan 11, 2009 10:51 am    Post subject: space between objects Reply with quote

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. Smile
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Sun Jan 11, 2009 11:30 am    Post subject: Reply with quote

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 Smile
DeleD on IRC
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Sun Jan 11, 2009 12:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sun Jan 11, 2009 12:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Grandmaster B
DeleD PRO user


Joined: 03 Jul 2007
Posts: 218

PostPosted: Sun Jan 11, 2009 2:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Sun Jan 11, 2009 3:23 pm    Post subject: Reply with quote

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. Wink
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Grandmaster B
DeleD PRO user


Joined: 03 Jul 2007
Posts: 218

PostPosted: Sun Jan 11, 2009 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Sun Jan 11, 2009 3:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum