Why are graphic coordinates measured at the top left?

I noticed that every computer graphics system I have ever used uses a left coordinate system with its origin in the upper left corner. Cairo, Java, Microsoft XYZ and most graphics programs use this system. I assume that they all belong to a common ancestor, but I can not find any links to this.

If I had to guess, I would say that it came from the VGA graphics mode, using the same coordinates as the text, which, of course, was based on how English is read from top to bottom, left to right, with the second line " below the "first line" ... but I'm doing it.

Could anyone tell a story or point me in the direction of the right story book?

+7
source share
3 answers

This is an old convention, and the reasons may be a little apocryphal. Here are some hypotheses I found:

It was obtained from the behavior of a CRT electron beam.

Scanning from top to bottom means that you do not need to wait until the first frame is sent first, you will only begin scanning as soon as you start receiving data. (Which again raises the question of why scanning is from top to bottom)

Allows the right coordinate system with the Z axis going to the screen, and not leaving it.

Annoyingly, Cocoa and Quartz use a lower left start.

+4
source

I do not know. I do not think there is a final answer. It is likely that when people still had console machines, it would be advisable to move from the upper left corner down to the right. How many people in the world read, as you said. It makes sense to put the origin there.

http://en.wikipedia.org/wiki/Memory-mapped_I/O

The wikipedia article has some info on memory mappings. Say, for example, we allocate part of our memory to shutdown and to pixels on the screen. And we let address 0 be the top left of the screen and move through pieces turning pixels on and off, depending on whether they are in memory. This is basically what the first article says.

I don’t know if they allow address 0 to be the upper left side of the display, but that makes sense and can simply be ported.

+1
source

I doubt that this is an old agreement that persists for heritage reasons. The advantage of UpperLeft is the lack of a language system that goes from bottom to top. So in UpperLeft it's easier:

  • To place multiline text
  • Work with pages of unknown or infinite height
  • If the page height changes (i.e., a larger or smaller device), in BottomLeft you need to translate each coordinate of the object, but in UpperLeft you will not.

The latter also applies to dynamic placement and layouts, where the coordinates of the graphic object are offsets to their parent

0
source

All Articles