Modifying OpenGL axis system

前端 未结 2 1460
你的背包
你的背包 2021-01-01 04:03

I\'m using OpenGL with gluPerspective, what would I need to do to make it use an axis-system which the origin is top left instead of bottom left?

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 04:39

    I would say direct operating on the projection matrix is a clean way for this operation. But if by any chance you need an alternative:

    You can just use glScalef(1.f, -1.f, 1.f) to flip the axis.

    This is also just an operation on the GL_MODELVIEW or GL_PROJECTION matrix (whatever is currently active).

提交回复
热议问题