Y-coordinate positive or negative

johanksonjohankson SEInsider, University ✭✭

Hi!

I need some conceptual support. I'm designing a line recognition tool and at the same time playing around with CocosSharp. The one thing that bothers me now is that Cocos uses in my world a flipped Y-axis (0 begins at the bottom of the screen).

So what I wanted to discuss is, if you download a nuget package that does line recognition, would you assume that the Y-axis begins at the top or lower edge of the screen?

I have no real preference in the matter other than if I should write my lib to use a Y-axis that starts from the bottom, the top or do a setting for flipping it? The reason why I care is that I have a lot of enumerations and functions containing words like Above and Below.

Your opinon would be great! :)

// Johan

Posts

  • angerurothangeruroth USMember

    Hi Johan,
    You can invert the Y-axis with something like VisibleBoundsWorldspace.MaxY - y, so the choice is yours. It mostly depends on your algorithms and preferences.
    If you write a library, given that you have recognized this matter, in my opinion you should allow both options (top 0 & bottom 0), because you don't know what option would like to choose the people using it, or if they have a constraint about it.
    Just my opinion ;)

Sign In or Register to comment.