Results 1 to 17 of 17

Thread: [Suggestion/idea] Calculating camera pitch level

  1. #1
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Lightbulb [Suggestion/idea] Calculating camera pitch level

    I've been wondering about a function that returns your camera angle (not compass) for a while. Has something like this ever been implemented in SRL before, using color only? I read somewhere that Brandon's GL include has a function that returns pitch level but I am looking for a color only solution. If there is anyone who has tried to tackle this problem before, please share your idea and/or progress.

    Thank you and have a good day

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    I guess a good start would be to try use the player model as a basis for the calculations. Most likely the only way to calculate it at least with some accuracy. For example get the height from lowest and highest angle with the position on main screen, then any values between those could simply be calculated.
    There used to be something meaningful here.

  3. #3
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    True, I've thought of that, but the problem with this idea is that if there is an obstacle infront of your character - tree or a wall and you can't see your player - this would not work as well. But then again, you could have it rotate the camera if a certain point on the player was not detected, such as top of head or feet or something and then proceed to calculate the height. :P

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    If there would be an obstacle in front of my character, I would most likely move my camera to make way for my character So rotating camera in such situations would be completely reasonable in my opinion. And to verify any test values you can use the console when developing this.
    There used to be something meaningful here.

  5. #5
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I have a pretty accurate way of determining the pitch on OSRS, but I'm guessing this question refers to RS3?

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I have a pretty accurate way of determining the pitch on OSRS, but I'm guessing this question refers to RS3?
    OpenGL was mentioned in the original post, so I would assume it's RS3
    There used to be something meaningful here.

  7. #7
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    @Flight Yes, this discussion was meant for RS3 but I don't see a reason to not include OS as well, as long as it involves color

    @Frement How would you go about setting a default point for the script to check hieght. What I mean is, different accounts always have different gear on so I don't see how to calculate a universal point for all. Pardon me, I'm new to this kind of development. Most of my scripts go like this: if health low then eat. Not much innovation as you can see

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by HT BaaFly View Post
    @Frement How would you go about setting a default point for the script to check hieght. What I mean is, different accounts always have different gear on so I don't see how to calculate a universal point for all. Pardon me, I'm new to this kind of development. Most of my scripts go like this: if health low then eat. Not much innovation as you can see
    Just throwing some ideas out there, but you could maybe get a big box around the playerPoint and calculate the most prominent color from outwards. Then use that color to mask out the ground and what not, and get the player model only by using edge detection or something else which you might come up with.
    There used to be something meaningful here.

  9. #9
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    I'm not sure if this will work or not but the idea I had was to:

    At the start of the script, grab a point on the player's head OR feet.

    When the camera goes up or down the calculate the offset of the head or feet from that point?
    I am Ggzz..
    Hackintosher

  10. #10
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    The two methods are similar to me, I think but in any case I'll try my luck and post any progress here

  11. #11
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    May I ask why you need a function like this? If you don't need to know current pitch, but need to make it a certain pitch, it will be easier to go MS_ANGLE_HIGH/LOW and then keyDown/up for a certain number of ms.

  12. #12
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    May I ask why you need a function like this? If you don't need to know current pitch, but need to make it a certain pitch, it will be easier to go MS_ANGLE_HIGH/LOW and then keyDown/up for a certain number of ms.
    I would assume this is for more human-like and accurate object clicking based on a minimap tile (for example a loot drop or NPC).
    There used to be something meaningful here.

  13. #13
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    @The Mayor If you have ever noticed while playing RS3, whenever you get disconnected from a server and automatically relog back in, your player's pitch level is set to the minimum. This can be troublesome if your script is not able to run properly at an angle other than the highest. For example, you can't see top part of the bank chest in CW if your pitch level is low. This leads me to think such function will be useful. As for your suggestion, it would seem very botlike to me if the player frequently tries to adjust his angle when it's already adjusted. So we need a function that returns an accurate pitch level. Hope I was clear

    Frement has valid points as well, this could greatly benefit minimap to mainscreen coords conversion

  14. #14
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by HT BaaFly View Post
    This can be troublesome if your script is not able to run properly at an angle other than the highest.
    This is why I asked what you needed the function for. If that's the reason, then there are much easier ways to go about it. If not findObject then set angle high, for example.

  15. #15
    Join Date
    Oct 2008
    Posts
    196
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    This is why I asked what you needed the function for. If that's the reason, then there are much easier ways to go about it. If not findObject then set angle high, for example.
    There's a difference between the easy way and the right way. For example, let's say that you're in a different area than the one which has the object. If you do go and call findObject then you're most likely going into a loop. I can think of a few other examples but I think you got the point, I just don't get why you are so unenthusiastic about this

  16. #16
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by HT BaaFly View Post
    There's a difference between the easy way and the right way. For example, let's say that you're in a different area than the one which has the object. If you do go and call findObject then you're most likely going into a loop. I can think of a few other examples but I think you got the point, I just don't get why you are so unenthusiastic about this
    Because this is not something that can be achieved with the needed (in my opinion) accuracy that easily.
    There used to be something meaningful here.

  17. #17
    Join Date
    Dec 2014
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Nice suggestion!
    Support.

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
  •