using two arrow keys to go diagonal in the 3d world

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

  1. #1

    Default using two arrow keys to go diagonal in the 3d world

    I am building a 3d world that will involve walking and flight. I want the user
    to be able to walk around in the world using the arrow key; ie 'UP' goes
    forward, 'Down' goes backward, 'Lefty strafes left and 'Right' strafes right.
    Fairly simple, or so I thought. Can anyone offer any help with the lingo that I
    need for this function?

    Thank You

    ImLearningW3D Guest

  2. Similar Questions and Discussions

    1. Arrow keys out of control - Wierd
      Hi, I'm Illustrator deficient and just beginning the learning process of Illustrator CS utilizing the Total Training tapes. In lesson 3 there...
    2. arrow keys fail
      Hi Folks, I published the completed example of the 'magic trick' director example, but on my PC using the arrow keys (or mouse click) fails to...
    3. MX Font Preview w/ Arrow Keys?
      I just MX-ed my Freehand, but there seems to be a feature missing that I liked: I used to be able to select a text box w/ some type in it, then...
    4. arrow keys datagrid
      Hi All, Bought the Flash MX datagrid component from Macromedia. Standard it does not handle the arrowkeys but they made an example on how to do...
    5. arrow keys in motif
      I can't seem to get the arrow keys on the number keys to work in motif -- NetBSD 96key pc keyboard(with the ctrl key where god intended it) ...
  3. #2

    Default Re: using two arrow keys to go diagonal in the 3d world

    sure, its quite easy
    you have to assosiate events of arrow key hits, with 3D world commands

    make a general script in the Cast, and make it:

    on keyUp

    --if the left arrow key was pressed:
    member("your3Dscene").camera/model("name").translate(5,0,0)

    end

    and so on.
    good luck!

    bgsBS Guest

  4. #3

    Default Re: using two arrow keys to go diagonal in the 3d world

    dear bgsBS,
    thank you for your input. This seems quite similar to the scripting that I
    was trying. The problem that I get is that one key will tanslate the camera
    properly, whereas using the, for example, UP and LEFT arrow keys at the same
    time won't translate the camera in the diagonal direction even when the
    translation vector is set correctly, ie (5,0,-5). Does your suggestion work
    around this descrepency or do you have the same effect that I do. Anyway,
    thanks for your time in this matter.

    ImLearningW3D


    ImLearningW3D Guest

  5. #4

    Default Re: using two arrow keys to go diagonal in the 3d world

    -- on enterFrame in a behavior or frame script or on idle in a movieScript if
    keypressed(123) then arrow_left = true if keypressed(124) then arrow_right =
    true if keypressed(125) then arrow_down = true if keypressed(126) then arrow_up
    = true if arrow_left then member('scene').model('name').translate(-speed,0,0)
    if arrow_right then member('scene').model('name').translate(speed,0,0) if
    arrow_down then member('scene').model('name').translate(0,0,-speed) if arrow_up
    then member('scene').model('name').translate(0,0,speed) Cheers, Karl.

    Newt99 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