Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert 3D Studio Max model (3DS/MAX) to QCAR SDK for iOS / OpenGL ES compatible format?

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
like image 612
Raptor Avatar asked Nov 04 '11 09:11

Raptor


1 Answers

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.

like image 179
the swine Avatar answered Nov 04 '22 12:11

the swine