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 

Center of 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
moraldi
DeleD PRO user


Joined: 08 Sep 2005
Posts: 112
Location: Hellas

PostPosted: Tue Oct 27, 2009 7:44 am    Post subject: Center of objects Reply with quote

Hi,
Could you please someone help me on the calculation of the center of an object using the vertices data from a .dxs file?

Thanks
Back to top
View user's profile Send private message Send e-mail
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Tue Oct 27, 2009 7:54 am    Post subject: Reply with quote

Depends on what center you mean. You can calculate it differently. You may take the bounding box of the object for instance, and calculate its center. Or you calculate the arithmetic or geometric mean of the vertices (sum of all coordinates divided by the number of vertices). If you want the center as a point inside the mesh of your object, that's going to be a lot more difficult Razz
_________________
Behold! The DeleD Wiki! Please help us expanding it Smile
DeleD on IRC
Back to top
View user's profile Send private message
moraldi
DeleD PRO user


Joined: 08 Sep 2005
Posts: 112
Location: Hellas

PostPosted: Tue Oct 27, 2009 8:16 am    Post subject: Reply with quote

All I need, is the reading of the center that is displayed in the Object Inspector

Back to top
View user's profile Send private message Send e-mail
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Tue Oct 27, 2009 8:53 am    Post subject: Reply with quote

I think this is the center of the bounding box, not sure though
_________________
Behold! The DeleD Wiki! Please help us expanding it Smile
DeleD on IRC
Back to top
View user's profile Send private message
Starnick
DeleD PRO user


Joined: 28 Jul 2007
Posts: 611

PostPosted: Tue Oct 27, 2009 8:57 am    Post subject: Reply with quote

Mr.Fletcher wrote:
I think this is the center of the bounding box, not sure though


I'm pretty sure that's correct.
Back to top
View user's profile Send private message Visit poster's website AIM Address
moraldi
DeleD PRO user


Joined: 08 Sep 2005
Posts: 112
Location: Hellas

PostPosted: Tue Oct 27, 2009 9:01 am    Post subject: Reply with quote

I don't know how to calculate the center of the bounding box Embarassed
Back to top
View user's profile Send private message Send e-mail
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Tue Oct 27, 2009 9:13 am    Post subject: Reply with quote

Well first you calculate the bounding box, which is the minimal and maximal value of all vertices of the object in all three dimensions. Then you take this minimum and maximum and the resulting center is (min + max)/2 for all three dimensions
_________________
Behold! The DeleD Wiki! Please help us expanding it Smile
DeleD on IRC
Back to top
View user's profile Send private message
moraldi
DeleD PRO user


Joined: 08 Sep 2005
Posts: 112
Location: Hellas

PostPosted: Tue Oct 27, 2009 9:36 am    Post subject: Reply with quote

It was so simple, shame on me! Embarassed
Thanks!
Back to top
View user's profile Send private message Send e-mail
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