【问题标题】:OpenGL glScissors center of coordinate systemOpenGL glScissors 坐标系中心
【发布时间】:2019-12-01 06:56:17
【问题描述】:

我的问题是我正在尝试执行 glScissors 调用以切断屏幕绘制区域,但该函数在窗口空间中的坐标系中心位于屏幕的左下角。 有没有办法改变中心的原点?我希望该功能相对于屏幕的左上角起作用。

【问题讨论】:

    标签: opengl


    【解决方案1】:

    不,但是您可以创建一个从一个坐标系统转换到另一个坐标系统的函数

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多