Sort of off topic. Rogue formula menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Lecht123's Avatar Member
    Reputation
    2
    Join Date
    Aug 2008
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sort of off topic. Rogue formula

    Does anyone know how to calculate the x,y position behind a target using it's current Orientation/Rotation.

    I'm not that great with math, yes even simple High School math like this.

    I appreciate any/all help.

    Sort of off topic. Rogue formula
  2. #2
    RiseAndShine's Avatar Member
    Reputation
    18
    Join Date
    Jan 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't test it, but this should work:

    Code:
    float tmpX = Math.Cos(Unit.Facing + (Math.PI / 2)) * 3; 
    float tmpY = Math.Sin(Unit.Facing + (Math.PI / 2)) * 3;
    
    int behindX = Unit.X - tempX;
    int behindY = Unit.Y - tempY;

  3. #3
    Lecht123's Avatar Member
    Reputation
    2
    Join Date
    Aug 2008
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That sort of works, it takes me to the left corner that's ALMOST behind it. I guess I need to figure out which direction the mob is facing to get directly behind it?

    Thanks for the response

  4. #4
    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)
    A player's position + his facing gives you a 2 dimensional vector, that's all you need.

    v = (target_x, target_y) + s * (cos(target_facing + pi/2), sin(target_facing + pi/2))

    Now you can just set s to -1 if you want to behind the target, or an even smaller number to be further behind.

    Might have ****ed up somewhere but that should give you an idea.

    Meh I did indeed. You'll have to adjust it to WoWs coord. system:
    Code:
          /\ x
           |
    <----|-----y
    so in wows system it should be: v = (target_x, target_y) + s * (cos(target_facing), sin(target_facing))
    as it's system is rotated by pi/2 to the common coord. system.

    Hope it's right now ~~ brb suicide
    Last edited by SKU; 02-21-2009 at 12:22 PM.

  5. #5
    Lecht123's Avatar Member
    Reputation
    2
    Join Date
    Aug 2008
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That works great, thanks both of you for responding. I would give rep if I could.

Similar Threads

  1. Off Topic!
    By xinrua in forum World of Warcraft General
    Replies: 0
    Last Post: 12-25-2007, 03:57 PM
  2. [Off Topic] Titan Quest
    By ironman2173 in forum Gaming Chat
    Replies: 1
    Last Post: 10-27-2007, 05:54 PM
  3. Most off-topic/fun forums EVER =P
    By Pimpin_N0ob in forum Community Chat
    Replies: 4
    Last Post: 08-01-2007, 01:08 AM
  4. [Off topic] Snitch's announcement
    By Snitch in forum Community Chat
    Replies: 9
    Last Post: 04-13-2007, 07:26 PM
All times are GMT -5. The time now is 08:32 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search