[Sharing] Vector Math with Lua


    May 22 2012 | 1:13 pm
    Hi everyone
    I was always searching for a simpler way to do vector operations (cross product, dot, length, normalize). And today I found my answer lying within lua. This is my first lua script and (as others already pointed out), it was way easier than I first expected. I also added an identifier for easy routing. So I hope this might be useful for someone out there and I finally can give back a little something to this great community! :)

    • May 26 2012 | 2:03 pm
      thank you, I was just searching for a clever way to do the same thing. my coding preferences are a bit different, so I used you patch unaltered and created the following:
      create a vector:
      getting a cross out of two vectors:
      calc the length of a vector:
      get the normalized vector:
      and last but not least a dot product out of two vectors:
    • May 26 2012 | 2:13 pm
      I was also looking for something like this. Is it possible to get angle/direction?
      Many thanks in advance