Professional Web Applications Themes

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. #1

    Default 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. #2

    Default 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
    group again about 90 degrees.
    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
    your problem.

    hondo3000 Guest

  3. #3

    Default 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
    grp.addChild(cube.model(grpArr))
    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
    grp.addChild(cube.model(grpArr[i]))
    end repeat
    grp.rotate(vector(0, 90, 0))
    end

    _sunny_ Guest

  4. #4

    Default 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
    grp.addChild(cube.model(grpArr))
    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. #5

    Default Re: Rotating group (begginers Q)

    this code worked!!! thanx one more time
    _sunny_ Guest

Similar Threads

  1. May 29 Sydney Developers Group study group
    By 105 in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 25th, 02:56 PM
  2. rotating jaw deformation
    By Roofy in forum Macromedia Director 3D
    Replies: 9
    Last Post: July 12th, 08:22 PM
  3. to many rotating objects
    By DANGH_b in forum Macromedia Director 3D
    Replies: 2
    Last Post: January 24th, 07:49 AM
  4. Rotating a DataGrid
    By Steve Heckler in forum ASP.NET Data Grid Control
    Replies: 5
    Last Post: June 2nd, 03:22 PM
  5. Rotating
    By Yohan webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 7
    Last Post: January 29th, 04:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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