Results 1 to 6 of 6

Thread: Auto compass adjustment for w&h for TPAtoATPAEx/SplitTPAEx

  1. #1
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default Auto compass adjustment for w&h for TPAtoATPAEx/SplitTPAEx

    In its current state, TPAtoATPAEx/SplitTPAEx does not take into account the compass direction when executing from the width and height parameters.
    This can cause inaccuracies when finding rectangular objects with much higher width than its height or vice versa. To demonstrate what i mean:

    With the compass facing north, the stone will be vertical, and if my w/h is set for vertical, its going to return a single ATPA and give me a single point perfectly. But if the compass were to turn to the east/west, it will become horizontal and hence the same width/height will result in 2 ATPA instead (and hence 2 points).

    So maybe we can have another TPAtoATPAEx/SplitTPAEx function dedicated to RS that calls rs_GetCompassAngleRadians, then adjusting the search rectangle to the same angle as the compass.

    I know this is to do with WizzyPlugin and isn't really to do with SRL include but cant find a more suitable place to post it.

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    This is my personal preference; to me it'd be easier to know the angle you are working with ahead of time, rather than trying to account for it. On the flip side, I see how looping through a check array of results and pulling the data that fits your criteria (or closest-to) may also be desirable. If anything becomes created as result to this thread, I couldn't think of a place aside from snippets for this -- again just my brain thoughts. Overall I do see purpose in this, as it helps increase accuracy potential within scripts.

  3. #3
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Well if you MiddleTPA the results you will get the same point anyways if you split it correctly. You can use sin/cos with the rad of the compass to compensate the angle. I don't think it's necessary. You should also realise that SplitTPA does not split the TPA in the width that you input! It does search for points within the width/height you input.

    The bottom picture should show it:

    Script source code available here: Github

  4. #4
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Can't you rotate the points before passing them to SplitTPA?
    Hup Holland Hup!

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    This is my personal preference; to me it'd be easier to know the angle you are working with ahead of time, rather than trying to account for it. On the flip side, I see how looping through a check array of results and pulling the data that fits your criteria (or closest-to) may also be desirable. If anything becomes created as result to this thread, I couldn't think of a place aside from snippets for this -- again just my brain thoughts. Overall I do see purpose in this, as it helps increase accuracy potential within scripts.
    I want to create scripts that can work with dynamic angles. I find it extremely bot-like to keep ur compass perfectly north all the time.

    Quote Originally Posted by J J View Post
    Well if you MiddleTPA the results you will get the same point anyways if you split it correctly. You can use sin/cos with the rad of the compass to compensate the angle. I don't think it's necessary. You should also realise that SplitTPA does not split the TPA in the width that you input! It does search for points within the width/height you input.

    The bottom picture should show it:
    I guess SplitTPAEx will result the same result most of the time (unless the width/height is super disproportionate). But TPAtoATPAEx will not be the case as i've demonstrated above, as even though all the points are accounted for, it's grouped wrongly (in my example, it should be a single ATPA instead of grouping the stone into 2 ATPA (due to the width not being long enough)

    Quote Originally Posted by nielsie95 View Post
    Can't you rotate the points before passing them to SplitTPA?
    Damn it, i thought i finally know all the WizzyPlugin after spending hours reading this, guess i'll read up the documentation. Thanks a lot!

  6. #6
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •