   Inverted Y Axis?
  In a couple of applications I have used, for the purposes of drawing to the screen, the origin is considered to be in the upper left corner with positive values on the x axis to its right -- just like in math class.  However, all values below the origin are considered positive rather than negative.Is this common in graphics programming, and if so, why?   
  They are called screen coordinates, screen coordinates are in the ( i think ) 4th quadrant eg. (-y)   |q2 | q1(-x)---------(+x)q3 | q4   | <screen coords here> (+y)// sorry for the poor ascii artq2  |  q1    |______________________________|______________________|_x_|    ||hp: 100  || q3 ||ammo: 50 ||    ||   o||    ||   O||    ||    ||    ||    ||    ||    ||    ||________________________||    '--------------------------'Atleast thats my take on it. feel free to research it further.   ;  actually, in math class when using the single quadrant cardesian plane, the lower left corner is (0,0), not the upper left.  All 2D graphics that i've ever seen have the origin at the top left, and it's probably because of the way graphics are drawn to the screen.   ;  Yep, the main reason Y normally goes downwards in 2D is because that's the way it is being sent to the screen. The lines are stored sequentially downwards internally, so it makes sense.In 3D Y normally goes upwards though.   ;Quote:Original post by Uther MortigastHowever, all values below the origin are considered positive rather than negative.Is this common in graphics programming, and if so, why?Technically, the resulting array of pixels that are to be sent to the display device, as Silk said, top-left to bottom-right.  There's nothing stopping you, however, from creating a class that allows you to work in a flexible coordinate system (i.e. a camera class, or transformation matrix, and etc ...)   ;  CRT displays had beam going left-to-right, top-to-bottom. So signal generator was simplest if it scanned memory in same way.Pixels in memory are stored sequentially:0123456789and when displayed on screen, they end up something like this0123456789...As a consequence, top left pixel has coordinates (0,0). X axis is positive to right. Y axis however would always be negative for any displayable pixel. So the easiest way is to simply declare it positive when going down.This is also convenient for conversion between memory location and logical coordinate. With Y being positive going down, the conversion is trivial: offset = y * width + x. Same goes for reverse: y = offset / width and x = offset mod width.If video memory were organized differently, converting into scanlines would require jumping over memory, resulting in more complex (expensive) logic.Today, between LCD monitors and modern GPUs, this is mostly irrelevant, but there's no need to fix what isn't broken. Internal data representation of raster graphics and images in general uses same coordinate system, since it is most natural to implement.   ;  Thanks, Antheus.  That explanation made perfect sense, and it answered my question perfectly.  (Though apparently I could have asked it more clearly.)   