7

适用于 iOS 的 Quancomm Augmented Reality (QCAR),它利用 OpenGL ES 来显示 3D 模型。它读取几个文件:

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

我的问题是,如何将 a 转换3D Studio Max (3ds/max) filevertices, texture coordinates, indices & normals list?另外,在转换过程中,是否也可以根据3DS文件中的设置生成shader文件?

这些文件用于 QCAR SDK for iOS,版本 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
4

1 回答 1

2

我相信您正在寻找的东西在这里:3DS to Header utility

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

于 2012-01-10T18:30:00.673 回答