广场投射到二维平面(OpenGL的ES2) [英] Projection of Square onto 2D Plane (OpenGL ES2)

查看:170
本文介绍了广场投射到二维平面(OpenGL的ES2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建Android上的CoverFlow视图的过程,但我处理的看法时,点击运行到路障一点点。我无法确定这广场是点击下面。为了确定单击的是哪个广场,(X,Y)从Click事件数据取并转换成OpenGL的视觉空间。麻烦来把这个在一个正方形的时候:换位,旋转和比较都可以在Java中进行,但是这似乎是一个巨大的浪费,因为渲染视图时,所有这些操作都正在做。

I'm in the process of creating a coverflow view for android, but I'm running into a little bit of a roadblock when handling clicks on the view. I'm having trouble determining which square is beneath the click. In order to determine which square is clicked, the (X,Y) data from the click event is taken and converted into the opengl view space. The trouble comes when placing this on a square: the transposition, rotation, and compares can all be done in java, but this seems like a huge waste, since all these operations are being done when rendering the view.

所以,我的问题是:我怎么能提取的OpenGL在2D视图映射对象的坐标渲染过程

我已经得到了我的大脑有点扭曲试图找出什么是真正在OpenGL模型和投影矩阵,而我似乎无法找到任何说明什么矩阵中的数字实际上的意味着的。

I've gotten my brain in a bit of a twist trying to figure out what is actually in opengl's model and projection matrices, and I can't seem to find any specification of what the numbers in the matrix actually mean.

谢谢!

推荐答案

您可以使用 gluUnProject() gluProject()对象和窗口空间并保存自己的一些数学之间的转换。文档是这里和的这里

You can use gluUnProject() and gluProject() for converting between object and window space and save yourself some math. Docs are here and here.

这篇关于广场投射到二维平面(OpenGL的ES2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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