简体   繁体   English

iPhone OpenGL ES-Glu,glPushName

[英]Iphone opengl es - glu, glPushName

Using Iphone and Objective C Im trying to find what plane has been clicked/touched in my opengl view. 使用Iphone和Objective C,我试图找到在我的opengl视图中被单击/触摸过的平面。 Typically i would use glPushName/ flPopName but this function doesn't seem to be implemented in the sdk or defined in . 通常,我会使用glPushName / flPopName,但是此功能似乎未在sdk中实现或未在中定义。 Does anyone know where to get there useful functions or another way to get the object that was clicked? 有谁知道在哪里可以找到有用的功能或以其他方式获取被点击的对象?

OpenGL ES doesn't support these functions. OpenGL ES不支持这些功能。 You'll have to find another way to pick. 您必须找到另一种选择方式。 Either: 或者:

  1. Render solid faces with distinct colors into a low-res buffer. 将具有不同颜色的纯色面渲染到低分辨率缓冲区中。 Select the render buffer resolution so that the pick square occupies a 3x3 pixel grid, choose either the color in the center pixel, or the color that occupies the most edge pixels. 选择渲染缓冲区分辨率,以使拾取正方形占据3x3像素网格,选择中心像素中的颜色或占据最多边缘像素的颜色。

  2. Determine the pick geometrically. 确定几何选择。 This usually entails placing your geometry in a BSP of some sort and doing interesection tests with a ray emanating downwards into the screen, starting from the tapped pixel. 这通常需要将您的几何体放置在某种BSP中,并进行横断面测试,并从轻击像素开始向屏幕下方放射光线。

  3. Determine the pick analytically. 分析确定选秀权。 If you geometry is simple and/or regular enough, you might be able to use some straightforward math to find out what you tapped. 如果您的几何很简单和/或足够规则,则可以使用一些简单的数学方法来找出您所利用的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM