7 Replies Latest reply on Mar 8, 2007 9:48 AM by biiin

    get and set modell positions and rotations

    biiin Level 1
      Hi!
      I have two diffrent moddels in one scene. I choose to hide one of the modells at the start. So the user can interact wiht one of the modells, rotatet it to be precis. Now i would like to hide the first modell, thats no problem, but when to second modell is unhided i would like it to have the same transformation as the first modell.

      Any ideas?I´m all out.
        • 1. Re: get and set modell positions and rotations
          Level 7
          at the point you wish to make the second model visible set it to the first
          model's transfrom like so:

          model2.transform = model1.getWorldTransform()
          model2.visibility = #front

          "biiin" <webforumsuser@macromedia.com> wrote in message
          news:esong7$4l1$1@forums.macromedia.com...
          > Hi!
          > I have two diffrent moddels in one scene. I choose to hide one of the
          > modells
          > at the start. So the user can interact wiht one of the modells, rotatet it
          > to
          > be precis. Now i would like to hide the first modell, thats no problem,
          > but
          > when to second modell is unhided i would like it to have the same
          > transformation as the first modell.
          >
          > Any ideas?I´m all out.
          >


          • 2. Re: get and set modell positions and rotations
            biiin Level 1
            Simple as that! You realy saved my neck!

            Much love!
            • 3. Re: get and set modell positions and rotations
              biiin Level 1
              ok...allmost there...maybe a little bit quick to mark the answer.
              http://www.qbik3d.com/demos/ba/
              Pls take a look at that, 0,9mb.

              Doesnt quit work all the time, and the drag to rotate doesnt allways work on first click. What am i doing wrong?
              • 4. Re: get and set modell positions and rotations
                Level 7
                no idea without seeing your code - please post your main behaviour script
                and i'll take a quick look

                "biiin" <webforumsuser@macromedia.com> wrote in message
                news:esot55$aqi$1@forums.macromedia.com...
                > ok...allmost there...maybe a little bit quick to mark the answer.
                > http://www.qbik3d.com/demos/ba/
                > Pls take a look at that, 0,9mb.
                >
                > Doesnt quit work all the time, and the drag to rotate doesnt allways work
                > on
                > first click. What am i doing wrong?
                >


                • 5. get and set modell positions and rotations
                  biiin Level 1
                  That is very nice of you!!
                  You can find the file here : director.dir

                  To understand the code:
                  svart = black
                  vit = white
                  the rest is not a matter of language skills in swedish ;-)
                  • 6. Re: get and set modell positions and rotations
                    Level 7
                    Glad to help - it got me away from building an IKEA chest of drawers for a
                    while ;)

                    There were a few little problems - rather than explain how to fix each step
                    i just did it and uploaded a new file for you to
                    http://www.kinelco.com/temp/director2.dir - it should hopefully all make
                    sense with the notes below:

                    1. The sofas didn't set the right transforms because you were setting them
                    the wrong way round - ie setting the white sofa to the transform of the
                    black before you turn the black one on - should be the other way round

                    2. The reset button was crashing the Director because you were performing a
                    resetWorld() - a resetWorld() is only really required when a sprite
                    initialises so you generally put it in the first beginSprite behaviour. The
                    reset button now calls a script in the Movie Script called resetSofas which
                    resets both sofas back to the origin and resets the Flash sprite so your
                    buttons are in the correct state

                    3. The sofa wasn't responding to clicks everytime because the invisible sofa
                    was being clicked on instead of the visible one. To overcome this i move the
                    sofas off screen as well as make them invisible

                    4. You had multiple Movie Scripts - not necessary - I put all your global
                    functions in one Movie Script - makes it much easier to deal with.



                    • 7. Re: get and set modell positions and rotations
                      biiin Level 1
                      WOOO! I cant be leave thise!
                      You´r to kind!

                      Don´t know how to thank you!
                      And good luck with the IKEA drawer!

                      Thank you so very very very very much!