How to get the center of an object?

Posted: 07-18-2004, 08:31 AM
I want to let some objects in my scene rotate with its center. These objects
maybe be far from the origin. I can not use the 'model.worldposition', because
I found it is (0,0,0) when debug, not the coordinates of the objects. So I want
the shape centers of them, or barycenters, or some point like this. How to get
it? Which fuction?

When debug, I found the boundingbox center seems to satisfy my requirement,
but I tried and tried, and can not retrieve it at last.

Reply With Quote

Responses to "How to get the center of an object?"

Ex Malterra
Guest
Posts: n/a
 
Re: How to get the center of an object?
Posted: 07-19-2004, 02:07 PM
boundingSphere returns a list with two elements, a vector representing the
position of the model and a float representing the radius of the bounding
sphere. you can use:

member("your3dWorld").model("yourModel").boundingS phere[1]

to get the entire position vector, or

member("your3dWorld").model("yourModel").boundingS phere[1][1].x
member("your3dWorld").model("yourModel").boundingS phere[1][1].y
member("your3dWorld").model("yourModel").boundingS phere[1][1].z

to get the x,y or z portion of the vector respectively.

Reply With Quote
 
LinkBack Thread Tools Search this Thread Display Modes
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to center webpage rocker00 Macromedia Dynamic HTML 1 09-17-2005 04:55 PM
is it possible to center a text? rlam Macromedia Flash Data Integration 1 02-23-2005 01:42 PM
center window karlogaga Macromedia Dynamic HTML 14 05-29-2004 03:48 AM
stroke - outside, inside, center rrose_selavy@adobeforums.com Adobe Illustrator Windows 4 05-27-2004 02:05 AM
Changing the center of rotation Amy Blankenship Macromedia Fireworks 1 07-24-2003 09:15 PM