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

1

7

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
Monohydric answered 4/11, 2011 at 9:52 Comment(4)
Why ".3ds" files? ".3ds" is an obsolete format. Can the answer include using 3dsmax itself or do you need it do work on files given to you without the use of 3dsmax?Except
yes. .3ds or .max files are fine. Just because still a lot free 3D models available to download online is in .3ds format.Monohydric
You still didn't answer if the 3dsmax software can be used. 3dsmax has several methods of dealing with mesh data so it makes sense to leverage that code base.Except
No. As 3dsmax has a high license fee, I cannot afford the price. Only free 3D software like Blender can be used.Monohydric
T
2

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.

Tonicity answered 10/1, 2012 at 18:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.