修改OpenGL的轴系统 [英] Modifying OpenGL axis system

查看:139
本文介绍了修改OpenGL的轴系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的OpenGL用gluPerspective,那么我需要做的,使其使用的轴系统的原点是左上角,而不是左下角?

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?

推荐答案

我想说的投影矩阵直接操作是一个干净的方式进行此操作。但是,如果任何机会,你需要一种替代方案:

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:

您也可以只使用 glScalef(1.F,-1.f,1.F)翻转轴。

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

这也只是在GL_MODELVIEW或GL_PROJECTION矩阵操作(无论是当前的活动)。

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

这篇关于修改OpenGL的轴系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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