适用于 iOS 的 Quancomm Augmented Reality (QCAR),它利用 OpenGL ES 来显示 3D 模型。它读取几个文件:
- 顶点、纹理坐标、索引和法线列表(ONE
.h
头文件的格式,例如 Teapot.h) - 纹理文件(PNG 格式)
- 着色器文件(FSH 和 VSH 格式)
我的问题是,如何将 a 转换3D Studio Max (3ds/max) file
为vertices, 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