Help with trig in my hack menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with trig in my hack

    I'm making a list of locations that will need to be 6 yards apart each. I have a start and end point. I'm using atan to get the angle for the right triangle. I was hoping someone could point me in the right direction to finish this up.

    Help with trig in my hack
  2. #2
    namreeb's Avatar Legendary

    Reputation
    658
    Join Date
    Sep 2008
    Posts
    1,023
    Thanks G/R
    7/215
    Trade Feedback
    0 (0%)
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Um, so you're trying to get the angle between your current facing direction and the next location in a list? More details please.

  3. #3
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I have no problem finding angle etc. I am having issues making the list of locations itself. I have a start and end location, but I need to find points in between at 6 unit increments.

  4. #4
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    implement a A* path finding. Google, and to get waypoints 6 yards apart check the distance from each waypoint to the next

  5. #5
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    No, I have no problem finding angle etc. I am having issues making the list of locations itself. I have a start and end location, but I need to find points in between at 6 unit increments.
    You really gotta be more specific. Is it supposed to be a staight line? There's an infinite number of ways to connect 2 points.

    If it's supposed to be a straight line:

    Point A(xa,ya,za) and point B(xb,yb,zb).

    v = (xb-xa,yb-ya,zb-za) = (xv,yv,zv)
    n = sqrt(xv^2 + yv^2 + zv^2)
    w = 1 / n * v

    OP[ i ] = OA + 6i * w = P[ i ] // P[ i ] is the i-th point that is 6*i yards away from point A into the direction of AB.

  6. #6
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that's what I was looking for. I needed a straight line. +rep.

    EDIT: I'm guessing that last part, OP[ i ] = OA + 6i * w = P[ i ], will have to be a matrix?
    Last edited by lanman92; 07-02-2009 at 12:55 PM.

  7. #7
    ggg898's Avatar Member
    Reputation
    10
    Join Date
    Jan 2009
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then theres another question, Im tired but cant figure out why you need several waypoints on a straight line...

  8. #8
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    void getPointsBetween(Vec3f a, Vec3f b, Vec3f *Points[])
    {
    	Vec3f v = a - b;
    	float n = sqrt(v.x*v.x + v.y*v.y + v.z*v.z);
    	Vec3f w = (1 / n) * v; // = Vec3f( (1/n)*v.x,  (1/n)*v.y,  (1/n)*v.z );
    
    #define STEPSIZE 2
    	int numPoints = n/STEPSIZE;
    	Points = new Vec3f[numPoints];
    	for( int i = 0; i < numPoints; i++ )
    	{
    		Points[i] = a + ((STEPSIZE*i)*w); // = Vec3f( a.x + STEPSIZE*i*v.x, a.y + STEPSIZE*i*v.y, a.z + STEPSIZE*i*v.z );
    	}
    }
    (Its 0437. Tired. Excuse errors.)
    Last edited by schlumpf; 07-02-2009 at 09:38 PM.

  9. #9
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much schlumpf

    EDIT: Anyone know how to make your window stay on top when you select WoW? It's an injected form through clr hosting, and topmost property doesnt work. Tips?
    Last edited by lanman92; 07-02-2009 at 10:06 PM.

  10. #10
    vulcanaoc's Avatar Member
    Reputation
    31
    Join Date
    Jul 2008
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use p/invoke to call SetWindowPos. SetWindowPos Function ()

    Pass HWND_TOPMOST to the second argument, hWndInsertAfter. HWND_TOPMOST can be defined as -1 *I think*.

    Of course, none of this may work.. I haven't tested it.

  11. #11
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure that won't work, but I'll give it a shot I have to imagine that this is the API that .NET uses internally.

    Nope, didn't work
    Last edited by lanman92; 07-03-2009 at 12:28 AM.

  12. #12
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've set my WoW to windowed and maximized, and my app to stay ontop, works fine for me. but that's not what you really want I assume


  13. #13
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, it's because my form is created behind WoW in z-order for some reason. It wants to stay that way. I've been looking for a way to draw a form onto a directx control or something... No avail yet.

    By behind in z-order, I mean that my window is a child of WoW and it wants to be in front. lol.

  14. #14
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by schlumpf View Post
    Code:
    void getPointsBetween(Vec3f a, Vec3f b, Vec3f *Points[])
    {
    	Vec3f v = a - b;
    	float n = sqrt(v.x*v.x + v.y*v.y + v.z*v.z);
    	Vec3f w = (1 / n) * v; // = Vec3f( (1/n)*v.x,  (1/n)*v.y,  (1/n)*v.z );
    
    #define STEPSIZE 2
    	int numPoints = n/STEPSIZE;
    	Points = new Vec3f[numPoints];
    	for( int i = 0; i < numPoints; i++ )
    	{
    		Points[i] = a + ((STEPSIZE*i)*w); // = Vec3f( a.x + STEPSIZE*i*v.x, a.y + STEPSIZE*i*v.y, a.z + STEPSIZE*i*v.z );
    	}
    }
    (Its 0437. Tired. Excuse errors.)
    Just wanted to point out to anyone who wants to use code based off this there are some things you need to keep in mind:
    The vectors are heap allocated and hence need to be manually deleted. To avoid this problem use a shared_ptr.
    The way the data is returned is also potentially more dangerous than it needs to be. You're better off either making the function take a vector by reference, or take an insertion iterator. The most obvious candidate for the latter being a back_inserter. The advantage of an insertion iterator is that you can generalize the algorithm so that it's not container-dependent.
    Also, if you're dealing with large data sets you might want to catch bad_alloc exceptions in-case 'operator new' throws (or if your C++ implementation uses a nothrow new implementation then do a null check), then return a boolean indicating whether the operation succeeded or not.

  15. #15
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, that's been a very ugly one. Its more C than ++. Ugly and dangerous, but at least working. ^^

Page 1 of 2 12 LastLast

Similar Threads

  1. [Request] can someone help with iphone hack please.
    By scaura in forum Pokemon GO Chat
    Replies: 0
    Last Post: 08-27-2016, 09:04 AM
  2. Help with powerfox 9900% damage hack
    By Miguelon6823 in forum WoW EMU Exploits & Bugs
    Replies: 8
    Last Post: 08-21-2009, 02:23 AM
  3. Need help with emu hack
    By thegreatkodo in forum WoW Scams Help
    Replies: 3
    Last Post: 07-28-2008, 06:09 PM
  4. Need help with a simple teleport hack
    By Login Error in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 04-27-2008, 02:25 AM
  5. need help with my hack
    By gonso in forum World of Warcraft General
    Replies: 2
    Last Post: 04-02-2007, 09:44 PM
All times are GMT -5. The time now is 07:12 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search