简体   繁体   English

OpenGL glScissors坐标系中心

[英]OpenGL glScissors center of coordinate system

My issue is that I'm trying to do the glScissors call to cut off the screen draw area, but the center of coordinate system for this function in window space is bottom left corner of the screen.我的问题是我正在尝试执行 glScissors 调用以切断屏幕绘制区域,但窗口空间中此函数的坐标系中心位于屏幕的左下角。 Is there a way to change the origin of the center?有没有办法改变中心的原点? I want the function to work in relation to the top left corner of the screen.我希望该功能相对于屏幕的左上角起作用。

No, but you can make a function that transforms from one corrdinate system to another不,但你可以创建一个函数,从一个坐标系转换到另一个坐标系

void scissorTopLeft(int x, int y, int w, int h, int screenHeight)
{
    glScissor(x, screenHeight-h-y, w, h);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM