Professional Web Applications Themes

Repositioning camera to wanted distance - Macromedia Director 3D

I have a smal problem what I can't solve myself so I need your smarter guys help. I have done a small movie where I have a character and camera. Camera is a child of character so it follows around when character is moved. Charater direction can be turned with mouse and camera stays behind the character. If mouses is moved up or down camera also move up or down and then points to character with pointAt(pCharacter) Because I only move camera on it's Y-axis with transale function and then turn it, camera slowly falls more and more behind of ...

  1. #1

    Default Repositioning camera to wanted distance

    I have a smal problem what I can't solve myself so I need your smarter guys
    help.

    I have done a small movie where I have a character and camera. Camera is a
    child of character so it follows around when character is moved. Charater
    direction can be turned with mouse and camera stays behind the character. If
    mouses is moved up or down camera also move up or down and then points to
    character with pointAt(pCharacter)

    Because I only move camera on it's Y-axis with transale function and then turn
    it, camera slowly falls more and more behind of the character.

    Now the stupid question: How do I calculate a new camera position so ti stays
    in same distance to character? ( I know, I'm stupid.) Or am I doing it all
    wrong with camera.translate(0,yAxis), camera.pointAt(pCharacter) then
    transalte again towards character method? Is there a better way to make a
    camera move like on sphere around desired object?

    VonCede Guest

  2. #2

    Default Re: Repositioning camera to wanted distance

    if you only turn the camera on the y-axix it will stay where it is and will
    stay relative to it's parent.

    yourcamera.transform.rotation=yourvector
    or
    yourcamera.rotate(yourvector)

    what are you doing that makes your camera left behind the charakter? can you
    post the code that makes it rotate?

    cheers!

    hondo3000 Guest

  3. #3

    Default Re: Repositioning camera to wanted distance

    [Q]if you only turn the camera on the y-axix it will stay where it is and will
    stay relative to it's parent.[/Q]
    I don't want to just turn camera. I want to turn camera so charater stays
    always in middle of the FOV.



    if the RightmouseDown then
    dMouse = (pMouse - the mouseLoc) / 100.0
    dx = dMouse.locV * pMouseSensitivity
    dz = dMouse.locH * pMouseSensitivity

    -- rotate character as mouse was moved on sideways.
    -- Camera will follow it as it is character's child
    pCharacter.rotate(0,0,dz)

    -- Move camera up/down behind the character
    pSprite.camera.translate(0,dx,0)

    -- Make camera point back to character
    pSprite.camera.pointAt(pCharacter.transform.positi on,vector(0,0,90))

    -- Make sure that camera stays in same distance to character. ( ie. dist =
    100)
    -- ???
    pMouse = the mouseLoc
    end if

    VonCede Guest

  4. #4

    Default Re: Repositioning camera to wanted distance

    [Q]Quote:
    if you only turn the camera on the y-axix it will stay where it is and will
    stay relative to it's parent.

    I don't want to just turn camera. I want to turn camera so charater stays
    always in middle of the FOV.[/Q]

    /me bang's his head on the keyboard.

    You were right. Like I said, I'm a bit stupid. Or a slow on today.

    member(whichCastmember).node(whichNode).rotate(rot ationVector {, relativeTo})
    will do a trick. I case anyone else ever wonders this same problem. (yeah
    right)

    /me hides back in dark corner in shame.

    VonCede Guest

Similar Threads

  1. camera.get for an outdoor camera ( not a webcam )
    By dsdsdsdsd in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: September 5th, 03:44 PM
  2. blend texture layers relative to camera distance
    By Grampa Gar in forum Macromedia Director 3D
    Replies: 0
    Last Post: June 15th, 04:48 AM
  3. snap distance > pick distance impossible?
    By TonMarkus in forum Macromedia Freehand
    Replies: 1
    Last Post: July 14th, 05:53 PM
  4. Repositioning a Column
    By Kartic in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 9th, 06:11 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