Make camera zoom and rotate around object

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default Make camera zoom and rotate around object

    This has been asked before - and not answered. So..

    "Is there any easy way to duplicate the sort of camera rotation found in
    Director's 3D preview window? -That is, where horizontal mouse movement rotates
    the camera around the world's Y axis and vertical movement rotates around a Z
    axis that's relative to the camera (or something... eh, like longitude and
    latitude lines on a globe)."

    I am trying to make a model visualizer, and the orbit camera and rotate
    objects behaviours are not very convincing...

    Thank you very much for any help.

    foq Guest

  2. Similar Questions and Discussions

    1. rotate object
      Is there anyway to rotate an object around another object's pivot?
    2. constraining the rotate axes of the camera
      Hi there all, I am tring to make a 3d world that allows the user to rotate with their mouse. Now following the instructions from the post that I...
    3. rotate camera along an axis
      hi i want to change only the X axis in the rotation properties of a camera .how can i do this. can anyone help me. thanking you all in advance...
    4. Camera Rotate - Help!
      Yay! I've no trouble with just rotating the camera with the keys, but how could I do it with the mouse, just like in every FPS, like Half-Life. ...
    5. How do I rotate an object?
      I've cut out an object with the Lasso tool and want to paste it into another photo, but I would also like to rotate the object. Not sure how to do...
  3. #2

    Default Re: Make camera zoom and rotate around object

    Heres some code I hacked out to control horizontal rotation. Will give you an
    idea at least

    Hope it helps




    on mousewithin me

    --the middle of the image
    myImageMiddle = sprite(me.spriteNum).width/2
    myImageLength = the mouseH - sprite(me.spriteNum).left

    if the mouseDown then
    tempDist = (sprite(5).camera.worldPosition).magnitude
    if tempDist > 500.00 then --crop tempDist to max
    tempDist = 500.00-- this is max distance to consider
    end if

    tempFactor = tempDist / 500.00--calculate scaling factor
    tempX = (the mouseH-prevMouseH)*tempFactor*2--edit 2 to alter speed

    -- THIS BIT TO TELL WHERE TO PIVOT
    sprite(5).camera.rotate(0,tempX,0,#WORLD)
    end if

    prevMouseH = the mouseH
    end

    otterman Guest

  4. #3

    Default Re: Make camera zoom and rotate around object

    [q]Originally posted by: ]foq
    "Is there any easy way to duplicate the sort of camera rotation found in
    Director's 3D preview window? -That is, where horizontal mouse movement rotates
    the camera around the world's Y axis and vertical movement rotates around a Z
    axis that's relative to the camera (or something... eh, like longitude and
    latitude lines on a globe)."

    I am trying to make a model visualizer, and the orbit camera and rotate
    objects behaviours are not very convincing...[/q]

    Study this example:
    [url]http://necromanthus.com/Games/ShockWave/tutorials/PanCamera.html[/url]
    For "Zoom In / Zoom Out" just translate the camera on its "X" axis.
    cheers



    necromanthus Guest

  5. #4

    Default Re: Make camera zoom and rotate around object

    Thank you both for your ideas. Otterman, I will check out your code later.
    Necromanthus, Iīll take a look at it as well, although in your example the
    camera is rotating around its own axis. Plus, isnīt FOV a better way to make
    zoom? By translating the camera, one could pass through the object being
    visualized...

    Again, thank you so much.

    Best.

    foq Guest

  6. #5

    Default Re: Make camera zoom and rotate around object

    [q]Originally posted by: foq
    Necromanthus, Iīll take a look at it as well, although in your example the
    camera is rotating around its own axis.[/q]

    There're 2 starting options. Use the second one (Targeted)


    [q]Originally posted by: foq
    Plus, isnīt FOV a better way to make zoom? By translating the camera, one
    could pass through the object being visualized...[/q]

    It's an option (but probably is not the best one).
    You should try them both to see the visual result.
    After that ... it's up to you.





    necromanthus Guest

  7. #6

    Default Re: Make camera zoom and rotate around object

    Oops. sorry for that.. there IS a target mode... I just realized that one second after re-visiting your site.

    It looks great, by the way. Should be just what I need.

    Thank you very much.
    foq Guest

  8. #7

    Default Re: Make camera zoom and rotate around object

    [q]Originally posted by: foq
    Oops. sorry for that.. there IS a target mode... I just realized that one
    second after re-visiting your site.

    It looks great, by the way. Should be just what I need.

    Thank you very much.[/q]
    There is something more:
    Q = Zoom In and A = Zoom Out
    have fun



    necromanthus Guest

  9. #8

    Default Re: Make camera zoom and rotate around object

    I coulndīt find the Zoom In and Out youīre talking about, but managed to get it
    done using FOV.

    (something like:)
    pCamera.fieldOfView = pCamera.fieldOfView - dx

    I guess thatīs it, for the moment. Thank you so much.

    foq Guest

Posting Permissions

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