[英]Where can I find an iPhone OpenGL ES Example that responds to touch?
I would like to find an iPhone OpenGL ES Example that responds to touch. 我想找一个响应触摸的iPhone OpenGL ES示例。 Ideally it would meet these requirements: 理想情况下它会满足这些要求:
Has anyone seen one or more examples that can do these or at least render the cube with the texture? 有没有人看过一个或多个可以做这些或者至少用纹理渲染立方体的例子?
My iPhone application Molecules has its source code available via a BSD license. 我的iPhone应用程序Molecules 的源代码可通过BSD许可证获得。 It uses OpenGL ES to render a molecular structure, using single touches to rotate the structure, a pinch gesture for zooming, and simultaneous movement of two fingers for panning across the molecule. 它使用OpenGL ES渲染分子结构,使用单个触摸旋转结构,缩放手势用于缩放,以及两个手指同时移动以在整个分子上平移。 Unfortunately, it does not yet use textures for any of the rendering it does. 不幸的是,它还没有使用纹理进行任何渲染。
I document some of the things I've learned about OpenGL ES from it here and here . 我在这里和这里记录了我从中学到的关于OpenGL ES的一些知识。
Sounds like you're looking for more than one example: 听起来你正在寻找不止一个例子:
You're welcome! 别客气!
对于响应触摸事件的示例OpenGL ES代码,请查看Apple的GLPaint示例代码。
I haven't found example code for this exact task, but here's a tutorial about the iPhone touch API . 我还没有找到这个确切任务的示例代码,但这里有一个关于iPhone touch API的教程。 Using the code from there, you should be able to react on touch events. 使用那里的代码,您应该能够对触摸事件做出反应。 For the graphics, look at this site that contains various OpenGL ES examples. 对于图形,请查看包含各种OpenGL ES示例的此站点 。
I can recommend this link: http://andreicostin.com/index.php/brain/2009/09/21/iphone_opengl_demo_3d_cube_with_texture_ 我可以推荐这个链接: http : //andreicostin.com/index.php/brain/2009/09/21/iphone_opengl_demo_3d_cube_with_texture_
HTH. HTH。
Regards, Andrei 此致,安德烈
Looks like you're going to need to implement the UIResponder interface: 看起来你需要实现UIResponder接口:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIResponder_Class/Reference/Reference.html http://developer.apple.com/library/ios/#documentation/uikit/reference/UIResponder_Class/Reference/Reference.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.