[Request] Help with coördinates walking / source code. menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Dronelol's Avatar Member
    Reputation
    2
    Join Date
    Jan 2014
    Posts
    3
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Request] Help with coördinates walking / source code.

    Dear ownedcore,

    I'm currently writing a bot which reads my current position (X,Y Coordinate) and heading (facing from north in degrees). What I want to is fill in coordinates I want to go to, then based on the coordinates I'm currently on, calculate the heading I need to face in order to get to the destination coordinates. Now I've done some research and figured out the Atan2 function is the way to do it.

    What I've learned about the WoW coordinate system is:
    -If you walk south, your Y coördinate value increases.
    -If you walk east, your X coördinate value increases.

    Now based on this I set up this Atan2 function in C#:
    Code:
    double angle = Math.Atan2(bX - aX, bY - aY) / (Math.PI /180) + 180;
    Whereas b stands for destination, and a for current location. Which basically means, delta X and delta Y.

    Now this all seemed to make total sense and worked perfectly for all basic angles (90° and 45°).

    A quick example:
    Code:
    aX = 50.00
    aY = 80.00
    
    bX = 52.00
    bY = 52.00
    
    (A 45° angle).
    would return 225°, which fits perfectly with the ingame degree system. I've tested all angles ingame (45,90,135,180,225,270,315 & 360°). Everything worked perfectly.

    Now everything made total sense until this point, whereas I ended up testing some "real" coördinates, and things seemed to be a little off here.
    Code:
    double aX = 49.004501104355 ;
    double aY = 93.001425266266;
    
    double bX = 50.004827976227;
    double bY = 88.004219532013;
    would return the angle 348,680303112313. Now if you look at my attatchment:

    [Request] Help with coördinates walking / source code.-results-jpg

    you can see that if I follow this heading it would get me to 49,66 - 88,00 rather than 50,00 - 88,00.

    Is there someone who can explain the difference between these kind of angles and the classic 45° and 90° angles? Is there some kind of offset I'm missing? I know that people have done this kind of "basic" thing and I'm really interested in the solutions people have come up with. Perhaps people have encountered this same issue, or have another solution that works? If so, I would be really greatful if someone can provide me some source code.

    Thanks in advance,

    Dronelol
    Last edited by Dronelol; 02-06-2014 at 09:05 PM.

    [Request] Help with coördinates walking / source code.
  2. Thanks MurderBurger (1 members gave Thanks to Dronelol for this useful post)
  3. #2
    Dronelol's Avatar Member
    Reputation
    2
    Join Date
    Jan 2014
    Posts
    3
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Been months since I posted this without replies, perhaps people would know a solution by now

Similar Threads

  1. [Request] Help with Photoshop!
    By Randie in forum Art & Graphic Design
    Replies: 4
    Last Post: 06-13-2008, 06:44 AM
  2. [Request] Help with Warglavirs
    By henkeike in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 05-22-2008, 04:37 PM
  3. [Request] Help with Changing poison proc to TF Proc
    By Maxpower111 in forum WoW ME Questions and Requests
    Replies: 8
    Last Post: 03-08-2008, 09:45 AM
  4. REQUEST : request help with druid forms edit
    By littleevil in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 11-23-2007, 09:02 PM
  5. [Request] Help with mount swap plz! +rep
    By oliax in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 10-02-2007, 02:36 PM
All times are GMT -5. The time now is 02:07 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