Opengl 中的相机

发布于 2024-10-23 18:51:35 字数 235 浏览 3 评论 0原文

我对这个话题完全陌生。我想创建一个应用程序,让我可以操纵相机的像素(就像 Photobooth [在某种程度上])。如何将 xCode 中的基本 OpenGL ES 模板“转换”为一个可以看到(原始)相机的应用程序。有我可以使用的示例代码吗?我看到了 Brad Larson 的模板(ColorTracking),但无法用它做任何事情,因为我真的不知道该怎么做......这一切听起来可能毫无希望,但我如何学习 OpenGl?

谢谢,JNK

I am completely new to this topic. I would like to create an app which let's me manipulate the pixels of the camera (like Photobooth [in a way]). How can I 'turn' the basic OpenGl ES template in xCode into an app where i can see the (raw) camera. Is there any sample code I could use? I saw Brad Larson's template (ColorTracking) but am not able to do anything with it, since I don't really know what to do... This all may sound hopeless, but how can I learn OpenGl?

thanks, JNK

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光清浅 2024-10-30 18:51:35

这一切听起来可能毫无希望,但我如何学习 OpenGl?

我不会直接回答你的问题,因为最好了解 OpenGL 的情况以及它是如何工作的,而不是仅仅将代码复制到 Apple 的示例项目中。

有许多可用于 OpenGL ES 的好资源,我想这取决于您的喜好。你可能不会从苹果开始,因为他们假设几乎所有与 GL 相关的东西你都已经知道/从其他地方学到了。大多数资源都会假设您熟悉 C(希望情况已经如此!)。

OpenGL ES 2.0 编程指南是一本特别好的书,有很多 iOS/iPhone 特定信息和代码示例 (http://opengles-book.com/)。也就是说,对 OpenGL(而不是 GL ES)的一般介绍可能对您更有用:许多相同的原则适用,并且在线和印刷版都有更多的资源。搜索有关“opengl 教程”的问题将为您提供指向正确方向的各种答案。

在非常高的水平上,您将希望使用 AVFoundation 从相机获取原始数据并将其应用到纹理,然后将该纹理映射到网格,然后您可以根据需要扭曲或使用该网格。

This all may sound hopeless, but how can I learn OpenGl?

I'm not going to answer your question directly, because it's probably better to have an idea of what's going on with OpenGL and how it all works, rather than just copying code into Apple's sample projects.

There are a number of good resources available for OpenGL ES, I guess it depends what your prefer. The place you probably don't start is with Apple, because they assume pretty much anything GL related you'll already know / have learnt from elsewhere. Most resources will assume you're comfortable with C (hopefully this is the case already!).

The OpenGL ES 2.0 Programming Guide is a particularly good book, with a lot of iOS/iPhone specific information and code samples (http://opengles-book.com/). That said, a general introduction to OpenGL (rather than GL ES) will probably be more useful to you: a lot of the same principles apply, and there's considerably more resources both online and in print available. Searching for questions about 'opengl tutorials' will get you a variety of answers pointing in the right direction.

At a very high level, you'll be wanting to grab the raw data from the camera using AVFoundation and applying them to a texture, and then mapping that texture to a mesh which you can then distort or play with as you choose.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文