transform.rotation gives me headache

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

  1. #1

    Default transform.rotation gives me headache

    Hello

    Im working with an Adventure game like Grim fandango. Currently im working on
    this script;

    when you get close to an interactive obejct, the characters head will look at
    the object with its head. If you rotate the body too much, the head will spin
    back to its original rotation relative to the body (it has to be realistic you
    know ;P) Everyone who's played Grim Fandango will know what I mean.

    THe script is working perfectly. But not everywhere. If the characters Y
    position in the world is bigger then the object he'll be looking at's Y
    position, then things will get nasty. Nothing seems to work anymore. And now
    i've realized what the problem is; if the characters rotation.z gets higher
    then 180 then it will switch to -180 and the other way around and the script is
    constructed like this "If body.transform.rotation.z - V1 > 100 or < 100 then"
    where V1 is the angle the head should rotate to point at the object.

    so, is there any way I could..."reset" the characters transform.rotation.z
    when hes Y position gets bigger then the objects Y position? Or do you have any
    other solutions for my problem?

    cheers




    Pelleyoo Guest

  2. Similar Questions and Discussions

    1. Bit of a headache
      Hi all, I have found this bit of javascript to validate a users form input, but the problem is that it does it in steps - ie it will check the...
    2. Rotation between two transform.rotation vectors.
      Hello, I think my subject is pretty straight forward. :) I am looking for a way for my 3D character to slowly rotate between two vectors. The...
    3. transform.rotation.y in javascript
      Hi, How do you write: member("theModel").model("furniture_group").transform.rotation.y = 200 ... in javascrippt? I've tried: var myModel =...
    4. rotating about parent and "self" with transform.rotation?
      Hi is it possible to first rotate a model about its parent node and then rotate it about its own axis (or vice versa - that doesn't matter. The...
    5. rotation error when using transform
      hi all, when i use the transform.rotation to adjust the x and z axis data to 0, the y axiz data will get error(e,g, 76 degree) ..... because the...
  3. #2

    Default Re: transform.rotation gives me headache

    Setting the rotation around the y-axis is not recommended. Instead, you should use the .rotate() method, which rotates the given model a given angle. Or in your case, you could try using pointAt().
    openspark 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