View previous topic :: View next topic |
Author |
Message |
moraldi DeleD PRO user
Joined: 08 Sep 2005 Posts: 112 Location: Hellas
|
Posted: Tue Oct 27, 2009 7:44 am Post subject: Center of objects |
|
|
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 |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Tue Oct 27, 2009 7:54 am Post subject: |
|
|
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 _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC |
|
Back to top |
|
|
moraldi DeleD PRO user
Joined: 08 Sep 2005 Posts: 112 Location: Hellas
|
Posted: Tue Oct 27, 2009 8:16 am Post subject: |
|
|
All I need, is the reading of the center that is displayed in the Object Inspector
|
|
Back to top |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Tue Oct 27, 2009 8:53 am Post subject: |
|
|
I think this is the center of the bounding box, not sure though _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Tue Oct 27, 2009 8:57 am Post subject: |
|
|
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 |
|
|
moraldi DeleD PRO user
Joined: 08 Sep 2005 Posts: 112 Location: Hellas
|
Posted: Tue Oct 27, 2009 9:01 am Post subject: |
|
|
I don't know how to calculate the center of the bounding box |
|
Back to top |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Tue Oct 27, 2009 9:13 am Post subject: |
|
|
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
DeleD on IRC |
|
Back to top |
|
|
moraldi DeleD PRO user
Joined: 08 Sep 2005 Posts: 112 Location: Hellas
|
Posted: Tue Oct 27, 2009 9:36 am Post subject: |
|
|
It was so simple, shame on me!
Thanks! |
|
Back to top |
|
|
|