[Question] Why did Hedgewars using inverted-y basis coordinate?

1 reply [Last post]
UltiMaxKom
UltiMaxKom's picture
User offline. Last seen 4 years 12 weeks ago. Offline
Joined: 2016-06-26
Posts: 381

Hi Wink Smiley

PS: Please sorry for my english mistakes (I just hope I say its correctly and you can understand it)

As the title said, I want to ask trivial question, but may effecting so much for my works
Yup! Why did Hedgewars using inverted-y basis coordinate??
In alternative question, I wondering why don't we use normal coordinate. Instead, we use inverted-y coordinate system where the y doesn't increased from bottom to top but y increased from top to bottom
If you understand what I mean than thanks! If not, uhm, idk how to say it in other word =/

I know this may seems trivial, but this aspect is a REALLY BIG part of the game itself
If we change this system once more, then everything should be ruined instantly (I assume it will)

FYI: I concern about this because my so-called-angle-system was heavily harder to make when the quadrant of coordinates follow the clockwise of normal coordinate should be (making first quadrant are in bottom-right of the coordinate origin)
And, my angle works really good, as good as a broken compass would be
ITS SAY THE OTHERWISE! lol
But don't worry, with the power of the moon, ofc its not a problem to me at all in the end
Just a little bit weird though (its not a problem!)

Thanks for letting me know ;]
ONCE AGAIN! Its not a problem! Trivial guys!

╟───NW──────┼──────N╢

╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜

nemo
nemo's picture
User offline. Last seen 1 week 3 days ago. Offline
Joined: 2009-01-28
Posts: 1861

So.. I'd have to speculate as to what unc0rr's thinking was, but 0,0 starting in upper left is typical for images.
Hedgewars was loading images so unsurprising it might have followed same layout. This is handy if you are trying to work out coordinates on a map btw. Just fire up GIMP and as long as the map is a power of two (like 2048 x 1024) the coordinates will be exactly the same.

Oh, and this is probably the more likely reason... since upper left is default for images, SDL uses that for image reads too, so probably the fact that that was the representation in the SDL image arrays already encouraged defining it that way for the world array too to keep everything oriented in the same direction.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]