如何在 Qualcomm 的 Vuforia 示例应用程序中进行更改

发布于 01-04 04:08 字数 345 浏览 2 评论 0原文

我一直在浏览高通论坛上的帖子,但没有运气,因为我不知道到底如何寻找我想要的东西。

我正在使用 iOS 版 ImageTargets 示例,并且我想将茶壶更改为另一个我有图像(而是文本)。

我已经有了渲染,并且使用 opengl 库获得了 .h,但我不知道需要更改什么才能使这项工作正常工作,因为这是非常基本的,我无法使其工作真的没有冒险去尝试其他的东西。

有人可以帮我吗?

我会在这里粘贴代码,但这是一个完整的项目,所以我不知道如果需要的话到底要放什么,请告诉我。

I have been looking through the threads at the Qualcomm Forums but no luck since I don't know exactly how to look for what I want.

I'm working with the ImageTargets Sample for iOS and I want to change the teapot to another image (a text rather) I had.

I already have the render and I got the .h using opengl library but I can't figure out what do I need to change to make this work and since this is the very basic and I haven't been able to make it work I really haven't ventured to try anything else.

Could anyone please help me out?

I would paste code here but it's a whole project so I don't know exactly what to put if needed please let me know.

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

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

发布评论

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

评论(3

望她远2025-01-11 04:08:58

如果这种情况仍然有效,则您需要执行以下操作:

  1. 获取 3D 对象的头文件
  2. 获取该对象的纹理图像
  3. 在 EAGLView.mm 中进行以下更改:

    • 导入“yourobject3d.h”
    • 将纹理添加到textureFilenames数组(这应该位于EAGLView的开头
    • 最终要注意 kObjectScale(默认情况下约为 3.0f,对于一个对象,我必须将其更改为 120.0f)
    • 在 setup3dObjects 方法中,将正确的顶点/法线/纹理坐标数组(检查“yourobject3d.h”文件中的正确数组和命名)分配给 Object3D *object
    • 在 renderFrameQCAR 中进行此更改

      //glDrawElements(GL_TRIANGLES, obj3D.numIndices, GL_UNSIGNED_SHORT, (const GLvoid*)obj3D.indices);
      glDrawArrays(GL_TRIANGLES, 0, obj3D.numVertices);
      

我相信这就是全部...如果有什么内容请查看 Vuforia 的论坛,即这里: https://developer.vuforia.com/node/2047669

注意:默认的 teapot.h 确实(!)有索引,这些索引不存在于banana.h(来自下面的评论)所以也要注意这一点

If the case is still valid, here's what you have to do:

  1. get header file for 3D object
  2. get texture image for this object
  3. in EAGLView.mm make this changes:

    • import "yourobject3d.h"
    • add your texture to textureFilenames array(this should be at the begining of EAGLView
    • eventually take care about kObjectScale (by deafult it was about 3.0f, for one object I did have to change it even up to 120.0f)
    • in setup3dObjects method assign proper arrays of vertices/normals/texture coords (check in "yourobject3d.h" file for proper arrays and naming) to Object3D *object
    • make this change in renderFrameQCAR

      //glDrawElements(GL_TRIANGLES, obj3D.numIndices, GL_UNSIGNED_SHORT, (const GLvoid*)obj3D.indices);
      glDrawArrays(GL_TRIANGLES, 0, obj3D.numVertices);
      

I believe that is all... if something take a look at Vuforia's forum, i.e. here: https://developer.vuforia.com/node/2047669

NOTE: default teapot.h does (!) have indices, which are not present in banana.h (from comment below) so take care about that too

简美2025-01-11 04:08:58

查看 EAGLView.mm 文件。在那里,您必须加载纹理(图像)和 3D 对象(您需要导入 .h 而不是 Teapot.h 并相应地修改 setup3dObjects)。

它们最终通过调用 renderFrameQCAR 函数进行渲染。

Have a look at the EAGLView.mm file. There you'll have to load the textures (images) and 3d objects (you'll need to import your .h instead of teapot.h and modify setup3dObjects accordingly).

They are finally rendered by calling the renderFrameQCAR function.

征﹌骨岁月お2025-01-11 04:08:58

事实上,茶壶并不是一个形象。它是以 .h 格式存储的 3D 模型,其中包括顶点、法线和纹理坐标。您应该对 OpenGL ES 有很好的了解,才能理解示例应用程序中的这些代码。

将 3D 模型更改为您想要的任何内容的一种更简单的方法是使用渲染引擎,该引擎可以促进绘图和渲染内容,并且您无需打扰 OpenGL API。我已经在 Android 平台上使用 jPCT-AE 完成了此操作,但对于 iOS,有一个名为 OpenFrameworks 引擎的对应引擎。它有一些插件可以加载 3D 或 MD2 文件,并且由于它是用 C++ 编写的,因此您可以轻松地将其与 QCAR 集成。

这是我使用 jPCT 和 QCAR 结果的简短视频:
Qualcomm Vuforia + jPCT-AE 测试视频

Actually, teapot is not an image. It's a 3D model stored in .h format which includes Vertices, Normals, and Texture coordinates. You should have a good knowledge of OpenGL ES to understand those codes in sample app.

An easier way to change the 3D model to whatever you want is to use a rendering engine which facilitates the drawing and rendering stuffs and you don't need to bother OpenGL APIs. I've done it with jPCT-AE for Android platform but for iOS there is a counterpart called OpenFrameworks engine. It has some plugins to load 3Ds or MD2 files and since it's written in C++ you can easily integrate it with QCAR.

This is a short video of my result with jPCT and QCAR:
Qualcomm Vuforia + jPCT-AE test video

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