1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Weave light to take you to your highest hopes - the 6th Special Effect Contest is here!
    Dismiss Notice
  4. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] From 2D to 3D Triggering

Discussion in 'Triggers & Scripts' started by nyks078, Nov 3, 2011.

  1. nyks078

    nyks078

    Joined:
    Oct 28, 2011
    Messages:
    23
    Resources:
    0
    Resources:
    0
    Hi there guys. This is my first post here in Hive =)

    Actually I really have the ability to solve 3D functions but even though i have somewhat "above average" GUI triggering and know the fundamentals of jass, I still find it hard on getting to the right point.

    I use Coordinates instead of Locations because i have heard that it's much faster...but, bang... I just can't get it right...
    What does wc3 use in computing angles? i try converting Atan2(b,a) to radians or degree(same converting Sin(a)*c and Cos(a)*c) but to no avail. In GUI they're doing just fine but I need it in jass...I already mess up un 2D and that's why i can't move on triggering 3D functions...

    ...anyways, I really need this because I am doing a Race Game with real Physics. Thanks much. :goblin_yeah:

    -nyks078
     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    GUI (BJ functions) uses degrees, JASS (natives) uses radians.
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,976
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    JASS is almost completly in radians with exception of widget facing which for some reason is in degrees. This is the only time I know angular typecasting is required (when reading and setting unit facing or making a destructable). I do not know if camera orientation is in radians or degrees.
     
  4. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,035
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    http://warcraft.ingame.de/maps/mappedia/Pi

    Below are the functions that use radians, maybe SetSoundConeAngles uses it too, do not know what this function does/how to distinguish it.

    Although, as noted there, GetCameraField returns radians for roll, pitch and yaw, SetCameraField takes degree.
     
  5. Narogog

    Narogog

    Joined:
    Apr 1, 2010
    Messages:
    269
    Resources:
    1
    Spells:
    1
    Resources:
    1
    just use Atan2(x,y)* bj_RADTODEG
    for using sin/cos do Sin(facing*bj_DEGTORAD)it will do all that you need
     
  6. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    just use the value of bj_RADTODEG/bj_DEGTORAD directly if ever...
     
  7. nyks078

    nyks078

    Joined:
    Oct 28, 2011
    Messages:
    23
    Resources:
    0
    Resources:
    0
    ..wOw, i've been looking for this for a while! Thanks



    Thank you guys..oh man this is awesome. Problem solved, not anymore confused now
    ha,ha!!
     
  8. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,254
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Atan2 takes (y, x) not (x, y).