Professional Web Applications Themes

finding direction vector - Macromedia Director 3D

hi everyone I want to know if anyone knows how to figure out what the direction vector from one model to another is, like I want to shoot a missile from a ship towards a helicopter, but the only way I can think of to do it is to get something to pointAt the helicopter an then use the models transform.axis to do a modelunderRay to figure out whether or not to fire a missile, but what I want to know is are there any ways to skip the extra model pointAt thing and find what direction to put into ...

  1. #1

    Default finding direction vector

    hi everyone

    I want to know if anyone knows how to figure out what the direction vector
    from one model to another is, like I want to shoot a missile from a ship
    towards a helicopter, but the only way I can think of to do it is to get
    something to pointAt the helicopter an then use the models transform.axis to do
    a modelunderRay to figure out whether or not to fire a missile, but what I want
    to know is are there any ways to skip the extra model pointAt thing and find
    what direction to put into the modelUnderRay function.

    thanks

    James

    xeroe Guest

  2. #2

    Default finding direction vector

    hi everyone

    I want to know if anyone knows how to figure out what the direction vector
    from one model to another is, like I want to shoot a missile from a ship
    towards a helicopter, but the only way I can think of to do it is to get
    something to pointAt the helicopter an then use the models transform.axis to do
    a modelunderRay to figure out whether or not to fire a missile, but what I want
    to know is are there any ways to skip the extra model pointAt thing and find
    what direction to put into the modelUnderRay function.

    thanks

    James

    xeroe Guest

  3. #3

    Default Re: finding direction vector

    uhh, in case youre wondering, I didnt mean to post this more than once- I dont quite know how it happened- hope the mods take off the other posts

    James
    xeroe Guest

  4. #4

    Default Re: finding direction vector

    Hi there,

    If I understand correctly, you need to obtain a result vector by deducting
    the worldPosition of the ship from the worldPosition of the helicopter (or
    vice versa), then perform a .normalize() on the resulting vector. That is
    your direction to send the missile in. Although if it's a guided missile
    you'll need to constantly update the missiles path.

    Cheers

    Rix


    Richard Guest

Similar Threads

  1. point something in the direction of a unit vector
    By tedalde2 in forum Macromedia Director 3D
    Replies: 4
    Last Post: March 1st, 08:51 PM
  2. A little direction
    By d00mc0ck in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: November 14th, 03:16 PM
  3. Need Direction
    By jaziwebmaster in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: September 6th, 09:31 PM
  4. Replies: 0
    Last Post: July 10th, 01:04 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