7 Replies Latest reply on Jan 18, 2007 7:49 AM by otterman

    Orbit Camera

    JAH_P
      I'm hoping someone can help me with a script that will orbit a camera (only on x-axis) around an object. The premade script in the library works great, but need to change the wording to allow for the left and right arrows instead of left or right mouse buttons. Is there a way to change the library script provided with the program or can anyone help me with creating a script to do this function.
        • 1. Orbit Camera
          otterman
          Give this a go-
          • 2. Re: Orbit Camera
            Necromanthus Level 2
            quote:

            Originally posted by: JAH_P
            I'm hoping someone can help me with a script that will orbit a camera (only on x-axis) around an object.


            http://necromanthus.com/Games/ShockWave/tutorials/PanCamera.html
            note: start it in "Targeted" mode.

            • 3. Orbit Camera
              JAH_P Level 1
              otterman - I copied your script into my model. and am having an issue with what "x" should be. your line says -- sprite(x).camera <- what do i need to put in place of the "x". I did get it to work as sprite(1).camera when starting from a new movie with only the one model and no other sprites, so then i tried using sprite(242).camera --242 being the sprite number in the original project -- but it still comes up with "script error: property not found" at the bottom it says #camera.. what am i doing wrong???

              Also my camera (when using it as a new movie) will rotate around what seems to be the world not the object, what do i need to change in the script to rotate around the center of the object?
              • 4. Re: Orbit Camera
                JAH_P Level 1
                necromanthus - i started studing yours - i dont understand where the script is for your targeted and non targeted modes. as im following the script along i cant find what your global "w", "demo", "dmy", and "way" are? sorry probably too much to explain - otterman's script is probably better for my experience level, but im very interested to see how this works.
                • 5. Re: Orbit Camera
                  Necromanthus Level 2
                  quote:

                  Originally posted by: JAH_P
                  necromanthus - i started studing yours - i dont understand where the script is for your targeted and non targeted modes. as im following the script along i cant find what your global "w", "demo", "dmy", and "way" are? sorry probably too much to explain - otterman's script is probably better for my experience level, but im very interested to see how this works.


                  I see ...
                  Here is what's important to you:

                  if keypressed(123) then
                  -- Cursor Left is down
                  member("room").camera(1).rotate(vector(0,0,-1),member("room").model("target"))
                  end if
                  if keypressed(124) then
                  -- Cursor Right is down
                  member("room").camera(1).rotate(vector(0,0,1),member("room").model("target"))
                  end if


                  Simple enough, isn't it ?
                  cheers

                  • 6. Re: Orbit Camera
                    JAH_P Level 1
                    Thanks necromanthus!!! Also thanks for pulling out what i needed - this took seconds.
                    Still if you have a moment id really like to know how the rest of your sript worked???
                    • 7. Re: Orbit Camera
                      otterman Level 1
                      Sorry Jah! Only just remembered I posted to this query. The he x simply refers to the sprite number of your 3d member.

                      Also necromanthus has sum crackn examples of what can be done with director and shockwave- u learning from the best!