7
iOS的Quancomm增強現實(QCAR),使用OpenGL ES顯示3D模型。它讀取幾個文件:將3D Studio Max模型(3DS/MAX)轉換爲適用於iOS/OpenGL ES兼容格式的QCAR SDK?
- 頂點,紋理座標,指數&法線列表(在一個
.h
頭文件的格式,如Teapot.h) - 紋理文件(PNG格式)
- 着色器文件(在FSH和VSH格式)
我的問題是,如何將3D Studio Max (3ds/max) file
轉換爲vertices, texture coordinates, indices & normals list
?另外,在轉換過程中,還可以根據3DS文件中的設置生成着色器文件嗎?
這些文件用於iOS版本1.0的QCAR SDK中。
作爲一個例子,該文件內容如下:
#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
爲什麼「.3ds」文件? 「.3ds」是一種過時的格式。答案可以包括使用3dsmax本身,還是需要它在不使用3dsmax的情況下處理文件? –
是的。 .3ds或.max文件很好。僅僅因爲仍然有很多免費的3D模型可供在線下載使用.3ds格式。 – Raptor
如果可以使用3dsmax軟件,您仍然沒有回答。 3dsmax有幾種處理網格數據的方法,因此利用該代碼庫是有意義的。 –