3D character camera control

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

  1. #1

    Default 3D character camera control

    Hi,

    Just had a quick look and don't think this question has been answered before.
    I'm trying to get my camera to follow a character so the camera being just
    positioned above and slighly behind and pointed down so you can see whats in
    front of the character and still see its head. I've been playing around with
    trying with the setCameraChild method and get the camera to move with the
    character but when I rotate the character (using the arrow keys) the camera
    doesn't rotate to show the new view. Does anyone know how this could be
    achieved? Sample code will be a big bonus!!

    Thanks in advance for any suggestions.

    Brenden :camera;

    JustStupid Guest

  2. Similar Questions and Discussions

    1. Camera control
      :camera; How can I get the camera to move to the left or right (or vertically up & down for that matter) while pointing straight ahead,all the...
    2. Platformgame character control
      Ok, I got a proxy sphere and a character to follow it. It's a platform game. gamechar.transform = ball.transform like that I guess this isn't...
    3. How to get rid of control M character
      Hi, I'm using PHP code to develop a www interface to let users edit text files stored on a Solaris UX server. Users are using Windows based WWW...
    4. Control of web camera
      Hello, I'm trying to find out if it is possible to open up the sofware for a web cam take a picture and use it in my director movie. Basically...
    5. Camera control become inverse :(
      Hi there! I would like to use camera motion to interact with my 3D model instead of using drag Model fonction. My script work just fine but it...
  3. #2

    Default Re: 3D character camera control

    Update:

    Seem to be able to associate the camera with the character but the camera is
    not sticking with the character when it moves. Heres the code I have now:

    characterCam = MyWorld.camera[1]
    characterCam.transform.position = character.worldposition + vector (0,0,5)
    characterCam.transform.rotation = vector(90,0,180)
    character.addChild(characterCam)

    Any ideas??

    JustStupid Guest

  4. #3

    Default Re: 3D character camera control

    Hi,

    i made a camera following a character this way:
    1. i made 3 boxes invisible(box1.shader.blend = 0), box1 over the character
    ,box2 behind the character and box3 is intepolateing to box1

    on exitframe
    characterrotate = character.transform.rotation.z -- characterrotate is a var
    box2.transform.position.y = character.transform.position.y -- character is
    the moveing character
    box2.transform.position.x = character.transform.position.x -250 --moves
    box2 250 units behind character
    box2.rotate(0,0,characterrotate,character)

    box1.transform.position.z = character.transform.position.z + 30 -- moves
    box1 30 units above character
    box1.transform.position.y = character.transform.position.y
    box1.transform.position.x = character.transform.position.x

    camera1.transform.interpolateto(box2.transform,30) --camera interpolates to
    box 2
    box3.transform.interpolateto(box1.transform,15)
    camera1.pointat(box3, vector(0,0,1)) -- camera points at box 3 witch is
    interpolateing to box 1
    end

    2. the camera is using "interpolateto" becouse i dont want the camera to be
    fixed on the box, if the camera is fixed on the box it can result in a "noisy"
    movement of the camera( the camera may go up and down when the character
    follows a rough terrain)
    the camera point's at box3 to follow the charater in a more natural manner.

    Now if you move the characterter camera will follow and always point on on him.

    hope i made no mistakes in the script and sorry for my bad english.

    Daniel.

    danieloizo1 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