# position - Macromedia Director 3D

hi,all there is a box ,the initia position is vector(-79,45,0) when i use the method rotate member("X").model("box").rotate(vector(0,-7,0),vector(0,0,1),6) after the box rotate one angle,i get the WorldPosition BoxPos = member("X").model("box").WorldPosition but the position does not changed BoxPos is vector(-79,45,0) why? how can i get the new position?...

1. ## position

hi,all
there is a box ,the initia position is vector(-79,45,0)
when i use the method rotate
member("X").model("box").rotate(vector(0,-7,0),vector(0,0,1),6)
after the box rotate one angle,i get the WorldPosition
BoxPos = member("X").model("box").WorldPosition
but the position does not changed
BoxPos is vector(-79,45,0)
why?
how can i get the new position?

new3Duser Guest 2. ## Re: position

I cannot reproduce your results. Here are my steps.

Create a new movie, then create a Movie Script member with the following
scriptText:

on startMovie(me)
vMember = new(#Shockwave3D) -- will be erased
vResource = vMember.newModelResource("Box", #box)
vModel = vMember.newModel("Box", vResource)

vModel.worldPosition = vector(-79, 45, 0)
vModel.rotate(vector(0,-7,0), vector(0, 0, 1), 6)
put vModel.worldPosition

-- vector( -79.7317, 44.9617, 0.0000 )
--vMember.erase()
end

Now run your movie. You should see the output ...

-- vector( -79.7317, 44.9617, 0.0000 )

... in the Message window. This shows that the worldPosition of the Box model
has moved as a result of its rotation.

Have you set the floatPrecision to 0? This would account for there being no
figures after the decimal point in the value you cite for BoxPos. Even so, you
should see a value different from the start value:

-- vector( -80, 45, 0 )

I suspect that your code is returning the initial value for BoxPos, not the
value of member("X").model("box").WorldPosition.

openspark Guest 3. ## Re: position

thanks,openspark
new3Duser Guest #### Posting Permissions

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