Results 1 to 7 of 7
  1. #1
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,325
    My Mood
    Breezy

    Calculate vector distance

    Simple snippets in calculating vector distances.

    [highlight=vb.net]Private Structure Vector
    Public x As Single
    Public y As Single
    Public z As Single
    End Structure

    Private Function VectorDistance(ByVal vec1 As Vector, ByVal vec2 As Vector) As Double
    Return Math.Sqrt(Math.Pow(vec1.x - vec2.x, 2) + Math.Pow(vec1.y - vec2.y, 2) + Math.Pow(vec1.z - vec2.z, 2))
    End Function[/highlight]

    [highlight=c++]#include <math.h>

    typedef struct {
    float x;
    float y;
    float z;
    } Vector;

    float VectorDistance(Vector vec1, Vector vec2)
    {
    return sqrt(pow(vec1.x - vec2.x, 2) + pow(vec1.y - vec2.y, 2) + pow(vec1.z - vec2.z, 2));
    }[/highlight]
    Last edited by master131; 05-21-2011 at 09:59 PM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  2. The Following 4 Users Say Thank You to master131 For This Useful Post:

    cgallagher21 (05-22-2011),Locke (05-22-2011),lolbie (05-22-2011),Yamato (05-22-2011)

  3. #2
    Locke's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Bergen, Norway
    Posts
    804
    Reputation
    6
    Thanks
    67
    My Mood
    Yeehaw
    This is nice. Always fun to learn/watch new codes I've never seen before.

  4. #3
    cgallagher21's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    1,583
    Reputation
    11
    Thanks
    296
    My Mood
    Busy
    Looks Great Master

  5. #4
    lolbie's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Netherlands
    Posts
    5,207
    Reputation
    288
    Thanks
    2,090
    My Mood
    Angelic
    nice you just learned that with c++? ;p
    I love it when people keep their agreements /sarcasm ftw

  6. #5
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    8,643
    Reputation
    748
    Thanks
    1,818
    My Mood
    Doh
    Nice brain tommy. Well this would be nice if u want to make a aimbot, with a specific angle of distance :P
    Quote Originally Posted by KING View Post
    Stop FACKING SUMMONING ME TO THESE FUCKTARDS CONVOS.
    DAFUQ IS DIS FACKING SHYT.
    SHYT MAKES NO SENSE.

    On a side note. You fags are fucking hatting.
    You guys don't know shyt about spam.
    Danny would post on everysingle post every fucking hour, you couldnt tell which post was recent or anything. It was a fuck fest, he wouldnt have shyt to say....cares he posted like a fag he is.

    Josh made mutiple threads a day. And not just G, everywhere. That why everyone liked that dumb nikka.

    @Richard Nixon -Are you Endrat? @REAP @Digits2012 @Ghost -Son...I am dissapoint @Sjoerd -SMD @Canadian @FrosK -Dumb name is dumb @Nebulaa @That_Kid -Man Up @The XXX Devil -Oh look another joker avatar-how original and neat

    The rest who I didn't mention comment....Suck my left nut....but not to hard...it hurts.

  7. #6
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,325
    My Mood
    Breezy
    Quote Originally Posted by lolbie View Post
    nice you just learned that with c++? ;p
    erm, no. I googled 3D Math craps and found some formulas.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  8. #7
    Phizzo's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    My Mood
    Aggressive
    what program do u guys use to compile this? Visual basic ?