Android系统。在邻投影OpenGL ES的平局屏幕尺寸方 [英] Android. OpenGL ES draw screen size square in ortho projection

查看:111
本文介绍了Android系统。在邻投影OpenGL ES的平局屏幕尺寸方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenGL ES的是新。我读简单的教程,但我有设置邻问题,并绘制屏幕尺寸方形。你能提供简单的code作为例子吗?

I'm new in openGL ES. I read simple tutorials but i have problem with setup Ortho and draw screen size square. Could you provide simple code as example ?

推荐答案

正投影的一个很好的用法是,你可以指定单个持股量将影响有多大在你的应用程序时,你设置你的顶点数据。

A nice usage of the orthographic projection is that you can specify how big influence a single float will have in your application when you're setting your vertex data.

例如,可以考虑这样的解释:

For example, consider this explanation:

float right = 5.0f
float top = 4.0f
glOrthof(0.0f, right, 0.0f, top);

在上面的图片;具有四的对象(从三角形建),其尺寸等于1的的对应于正方形中的一个。

In the image above; an object that has a quad (built from triangles) whose size is equal to 1 also corresponds to one of the squares.

不久,它无关紧要哪些值传递到 glOrtho()的高度和右参数,只要你在你的顶点,设定正确的浮点值这应该对应于一平方。

Shortly, it doesn't matter which values you pass into the glOrtho() height and right arguments as long as you are setting correct float values in your vertices, which should correspond to one square.

这篇关于Android系统。在邻投影OpenGL ES的平局屏幕尺寸方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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