将 3D Studio Max 模型 (3DS/MAX) 转换为 QCAR SDK for iOS / OpenGL ES 兼容格式?

发布于 2024-12-14 04:53:03 字数 930 浏览 2 评论 0原文

适用于 iOS 的 Quancomm 增强现实 (QCAR),利用 OpenGL ES 来显示 3D 模型。它读取多个文件:

  1. 顶点、纹理坐标、索引和索引。法线列表(采用一个 .h 头文件的格式,例如 Teapot.h)
  2. 纹理文件(PNG 格式)
  3. 着色器文件(FSH 和 VSH 格式)

我的问题是,如何转换 3D Studio Max (3ds/max) 文件顶点、纹理坐标、索引和索引法线列表?另外,在转换过程中,是否也可以根据3DS文件中的设置生成shader文件?

这些文件用于 iOS 版 QCAR SDK 版本 1.0。

例如,文件内容如下:

#ifndef _QCAR_TEAPOT_OBJECT_H_
#define _QCAR_TEAPOT_OBJECT_H_


#define NUM_TEAPOT_OBJECT_VERTEX 824
#define NUM_TEAPOT_OBJECT_INDEX 1024 * 3


static const float teapotVertices[NUM_TEAPOT_OBJECT_VERTEX * 3] = 
{
// vertices here
};
static const float teapotTexCoords[NUM_TEAPOT_OBJECT_VERTEX * 2] =
{
// texture coordinates here
};
static const float teapotNormals[NUM_TEAPOT_OBJECT_VERTEX * 3] =
{
// normals here
};
static const unsigned short teapotIndices[NUM_TEAPOT_OBJECT_INDEX] =
{
// indices here
};

#endif

Quancomm Augmented Reality (QCAR) for iOS, which make use of OpenGL ES, to display 3D model. It reads several files:

  1. vertices, texture coordinates, indices & normals list (in format of ONE .h header file, e.g. Teapot.h)
  2. texture file (in PNG format)
  3. shader file (in FSH and VSH format)

My question is, how to convert a 3D Studio Max (3ds/max) file to the vertices, texture coordinates, indices & normals list? Also, during the conversion process, can the shader file be generated based on the settings in 3DS file as well?

The files are used in QCAR SDK for iOS, version 1.0.

As an example, the file content is as follow:

#ifndef _QCAR_TEAPOT_OBJECT_H_
#define _QCAR_TEAPOT_OBJECT_H_


#define NUM_TEAPOT_OBJECT_VERTEX 824
#define NUM_TEAPOT_OBJECT_INDEX 1024 * 3


static const float teapotVertices[NUM_TEAPOT_OBJECT_VERTEX * 3] = 
{
// vertices here
};
static const float teapotTexCoords[NUM_TEAPOT_OBJECT_VERTEX * 2] =
{
// texture coordinates here
};
static const float teapotNormals[NUM_TEAPOT_OBJECT_VERTEX * 3] =
{
// normals here
};
static const unsigned short teapotIndices[NUM_TEAPOT_OBJECT_INDEX] =
{
// indices here
};

#endif

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

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

发布评论

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

评论(1

雨落□心尘 2024-12-21 04:53:03

我相信您正在寻找的东西就在这里: 3DS 到标头实用程序

在回答你的第二个问题时,如果有人编写了 3DS 可以使用的所有可能的着色器,并根据材质属性编写了一些代码来选择和配置着色器,则 3DS 材质设置理论上可以转换为着色器。但不,没有直接/简单的方法来做到这一点。不过,如果我没记错的话,3DS 没有太多材质选择,因此可能不需要太多着色器来执行此操作。

i believe that what you are looking for, is here: 3DS to Header utility.

In answer to your second question, 3DS material settings could be in theory converted to shaders if someone wrote all possible shaders that 3DS can use and programmed some code to select and configure the shader, based on material properties. But no, there is no direct / easy way how to do that. Although, if i recall correctly, 3DS doesn't have too many material choices so there might be not too many shaders required in order to do this.

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