glOrthof和glViewPort的区别 [英] Difference between glOrthof and glViewPort

查看:736
本文介绍了glOrthof和glViewPort的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于OpenGL-ES我很困惑的区别是设置之间有什么

On OpenGL-ES i'm confused on what the difference is between setting

glOrthof()  
glViewPort()
GLU.gluOrtho2D()

与它的各个参数。因为我相信这是所有设置部分,你可以看到到指定的坐标(宽,高)。我应该使用哪一个?

with it's respective parameters. Since I believe it's all setting the part you can see to the specified coordinates (width, height). Which should I use?

推荐答案

glViewport determins窗口部分到OpenGL中绘图。这可能是整个窗口,或第(认为单机游戏的分屏模式 - 不同的视每一个球员)。

The glViewport determins the portion of the window to which OpenGL is drawing to. This may be the entire window, or a subsection (think console game's "split screen" mode- a different viewport for every player).

glOrthof 施加的正投影以当前矩阵,这是通常设置为投影矩阵此呼叫之前。投影矩阵结合模型视图,以产生一个矩阵,可将您的OpenGL坐标到屏幕坐标。

glOrthof applies an orthographic projection to the current matrix, which is usually set to the projection matrix before this call. The projection matrix is combined with the modelview to produce a matrix that translates your OpenGL coordinates to screen coordinates.

gluOrtho2D

这是相当于调用glOrtho附近= -1,远= 1。

This is equivalent to calling glOrtho with near = -1 and far = 1.

我建议此页如何查看和改造工作在OpenGL的更多细节。

I'd recommend this page for more details on how viewing and transformation works in OpenGL.

您应该使用哪个?视口和正投影有不同的关注点,所以你需要呼吁每个。 glOrthof和gluOrtho2D是大致相当;知道的差,并使用一个或另一个。

Which should you use? Viewports and orthographic projections are different concerns, so you'll need a call for each. glOrthof and gluOrtho2D are roughly equivalent; know the difference and use one or the other.

这篇关于glOrthof和glViewPort的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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