Quancomm Augmented Reality (QCAR) for iOS, which make use of OpenGL ES, to display 3D model. It reads several files:
- vertices, texture coordinates, indices & normals list (in format of ONE
.h
header file, e.g. Teapot.h) - texture file (in PNG format)
- 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