# Rotating group (begginers Q) - Macromedia Director 3D

hi everyone, i'm trying to rotate group of model members by Y axis at 90 degrees. everything works fine. when i'm ungrouping that group and creating it one more time adding the same models to it group rotates the same 90 degrees by Y axis not 180. i guess the problem is that every group member's position and rotation vectors don't change. i need that second time when i'm rotation that group at 90 degress angle it rotates by 180 degress total. i hope you understood my question. sorry for my english mistakes. thanx everyone respect...

1. ## Rotating group (begginers Q)

hi everyone,

i'm trying to rotate group of model members by Y axis at 90 degrees.
everything
works fine. when i'm ungrouping that group and creating it one more
time adding the same models to it group rotates the same 90 degrees by Y
axis not 180. i guess the problem is that every group member's position and
rotation vectors
don't change. i need that second time when i'm rotation that group at 90
degress angle it rotates
by 180 degress total. i hope you understood my question. sorry for my english
mistakes.

thanx everyone

respect

_sunny_ Guest

2. ## Re: Rotating group (begginers Q)

can you post the code that is used to rotate the group?
and it would be a good idea to post even the code that is used to group the
models.

are you using "yourGroup.transform.rotation=vector(0,90,0)" or do you use
"yourGroup.rotate(vector (0,90,0)"?

there is a difference.

If i understand your problem, you want to have a group of models rotated by 90
degrees around the y-axis. you rotate your group about 90 degrees, ungroup all
models from the group, and then you put them back into the group and rotate the
but your group does not rotate to a total rotation of 180 degrees its still 90
degrees.

i think you took "myGroup.transform.rotation=vector(0,90,0)" wich will set
the rotation to the exact vector of (0,90,0) if you want to add in this way 90
degrees you should use:
oldYrot=myGroup.transform.rotation.y
myGroup.transform.rotation.y=oldYrot+90

or try:
myGroup.rotate(vector(0,90,0))

this will rotate your group every time you execute this line about 90 degrees.

but this is only from my head and i am not sure if this will be a answere to

hondo3000 Guest

3. ## Re: Rotating group (begginers Q)

this is my code:

on mouseUp
cube = member("cube")
cube.deleteGroup("curr")
grp = cube.newGroup("curr")
grpArr = ["s_wbr", "s_wr", "s_wrg", "s_br", "s_blrb", "s_blr", "s_blgr",
"s_rg", "s_r"]
repeat with i=1 to grpArr.count
end repeat
grp.rotate(vector(0, 90, 0))
end

i've tried your method with oldYrot, but it didn't work.
after first rotaion group rotation vector is (0, 90, 0)
after second (180, 0, 180)
after third again (0, 90, 0)
i cann't understand why rotation vector changes like this? not (0, 90, 0), (0,
180, 0), (0, 270, 0) ...

i'm trying to make cube game. i need to group diferent walls of cube, and then
after ungrouping the the rotation and position vectors of seperate members i
guess have to be not as they where before transforming the group. or i'm wrong?

thanx for help. i appreceate

on mouseUp
cube = member("cube")
cube.deleteGroup("curr")
grp = cube.newGroup("curr")
grpArr = ["s_wbr", "s_wr", "s_wrg", "s_br", "s_blrb", "s_blr", "s_blgr",
"s_rg", "s_r"]
repeat with i=1 to grpArr.count
end repeat
grp.rotate(vector(0, 90, 0))
end

_sunny_ Guest

4. ## Re: Rotating group (begginers Q)

yes it sounds strange but i think it has to do with a fliping of the axis at
180 degrees ...

if you delete the old group and create a new one, than the newone will have
the rotation (0,0,0).
i think you should do this, its again from my head an i am not sure if the
axes flip again...

on mouseUp
cube = member("cube")
cubeOldRot=cube.Group("curr").transform.rotation -- !
cube.deleteGroup("curr")
grp = cube.newGroup("curr")
grp .transform.rotation=cubeOldRot -- !
grpArr = ["s_wbr", "s_wr", "s_wrg", "s_br", "s_blrb", "s_blr", "s_blgr",
"s_rg", "s_r"]
repeat with i=1 to grpArr.count
end repeat
grp.rotate(vector(0, 90, 0))
end

this should work but i am not sure if you tested it right now. may be you
should test without deleting the group and put all children in someother group
before you put them again into the group.

this will let your group where it is and keep its rotation. at the moment i
have no time to create a scene like yours but if you want to upload you dir
file we can have a look.

hondo3000 Guest

5. ## Re: Rotating group (begginers Q)

this code worked!!! thanx one more time
_sunny_ 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
•