当逻辑上将本机GL放在左下角时,为什么原点通常在绘画API中位于左上角? [英] Why is origin usually top left corner in painting APIs when logically and native GL is at bottom left corner?

查看:51
本文介绍了当逻辑上将本机GL放在左下角时,为什么原点通常在绘画API中位于左上角?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到很多图形API的0,0原点在左上角,因此y实际上随着它的增加而下降.我不知道为什么呢?在我个人认为更逻辑的左下角(常规x/y网格的原点)中不起作用,这又恰好是硬件渲染API中坐标的本机表示形式,是否有任何特别的优势?

I notice that a lot of drawing APIs have their 0,0 origin at the top left corner, so y actually goes down as it increases. I wonder why is that? Any particular advantage to not working in what I personally consider to be more logical bottom left corner (the origin of a regular x/y grid), which also happens to be the native representation of coordinates in hardware rendering APIs?

也许它与扫描线渲染甚至显示刷新的方式有关?

Or maybe it has something to do with the way scanline rendering or even display refresh goes?

推荐答案

具有左上角原点(向右x轴和向下y轴)的2D光栅图最有可能镜像CRT扫描模式.以这种方式组织的帧缓冲器-从上到下具有行主要像素-可以以线性顺序馈送到RAMDAC,以产生用于CRT的信号.其他组织将要求图形系统执行更多的算术运算,而没有实际的好处.

2D raster drawing having a top-left origin, with rightward x-axis and downward y-axis, is most likely mirroring the CRT scanning pattern. A frame buffer organized in this way -- with row-major pixels from top to bottom -- can be fed in linear order to the RAMDAC producing the signal for the CRT. Other organizations would require the graphics system to perform more arithmetic, for no practical benefit.

这篇关于当逻辑上将本机GL放在左下角时,为什么原点通常在绘画API中位于左上角?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆