How to get the center of an object?

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default How to get the center of an object?

    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.

    WrongAgain Guest

  2. Similar Questions and Discussions

    1. Center Backgroundimge II
      I fought it was fixed, but it ain't. I had problems with centering the background image and user told me to use CSS: No, not as a page...
    2. Accessibility Center?
      You know in Windows XP, when you use the Accessibility Wizard, once you set some "out-there" settings like XXL-sized fonts, abnormally fat...
    3. <center>
      Is there a way to use the html code fragment to insert <center> </center> to center the page. It's a pain to redo it every time you update all the...
    4. App Center and ASPX (IIS 6)
      Hello Martin, I am looking for someone who could help you on it. Thanks very much for posting here. Best regards, Yanhong Huang Microsoft...
    5. Center a div tag
      Hi The following div tag displays with a border. However, I want it to display center on the page. Any ideas welcome thanks jim <div...
  3. #2

    Default Re: How to get the center of an object?

    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.

    Ex Malterra Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139