I have noticed that every computer graphics system I have ever used uses a left-handed coordinate system with its origin in the upper left corner. Cairo, Java, Microsoft XYZ, and most graphics programs all use this system. I assume they all date back to a common ancestor, but I can't find any references about this.
If I had to guess I'd say it came from VGA graphics mode, using the same coordinates as text, which were naturally based on how the English language is read top-down, left-right, with the "second line" below the "first line"... but I'm making that up.
Was anyone around to tell the tale, or can point me in the direction of the correct history book?
The system and applications specify the position of a window on the screen in screen coordinates. For screen coordinates, the origin is the upper-left corner of the screen.
In terms of coordinates, a pixel can be identified by a pair of integers giving the column number and the row number. For example, the pixel with coordinates (3,5) would lie in column number 3 and row number 5. Conventionally, columns are numbered from left to right, starting with zero.
17.2 Coordinates for Graphics Most device coordinate systems are defined in terms of pixels, and usually the upper-left-hand corner is the origin of the coordinate system, with x coordinates increasing to the right and y coordinates increasing downwards.
It's an old convention, and the reasons might be a bit apocryphal. Here are some hypotheses I've found:
It's derived from CRT electron beam sweep behavior.
Scanning from top to bottom means you don't have to wait for an entire frame to be sent first, you just begin scanning as soon as you begin receiving data. (Which raises the question again, why scan from top to bottom)
It allows a right-handed coordinate system with the Z axis going into the screen rather than coming out of it.
Annoyingly, Cocoa and Quartz use lower-left origin.
I doubt that is an old convention that is kept due to legacy reasons. UpperLeft has the advantage, that is no language writing system that goes from bottom to up. So in UpperLeft is easier:
The last one extends also to dynamic placement and layouts, where a graphics object's coordinates are offsets to their parent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With