示例#1
0
void fxMeshMng::LoadFile(char * name)
{
FILE * f;
f = fopen(name, "rb");
import3DS(f, this);
fclose(f);
}
示例#2
0
void Item_node::importModel(const QString& filename){
	QString fn;
	if (filename.isEmpty()){
		fn = QFileDialog::getOpenFileName(NULL, tr("Open File"), "" , tr("Any Model (*.md2 *.MD2 *.md3 *.MD3 *.3ds *.3DS *.obj *.OBJ *.cr2 *.CR2 *.x *.X);;Quake2 Model (*.md2 *.MD2);;Quake3 Model (*.md3 *.MD3);;3DS Model (*.3ds *.3DS);;Obj Model (*.obj *.OBJ);;Poser Model (*.cr2 *.CR2);;DirectX Model (*.x *.X);;Cal3d binary Model (*.cmf *.CMF)"));
		//fn = QFileDialog::getOpenFileName(NULL, tr("Open File"), "" , tr("Any Model (*.md2 *.MD2 *.md3 *.MD3 *.3ds *.3DS *.obj *.OBJ *.x *.X *.cmf *.CMF);;Quake2 Model (*.md2 *.MD2);;Quake3 Model (*.md3 *.MD3);;3DS Model (*.3ds *.3DS);;Obj Model (*.obj *.OBJ);;DirectX Model (*.x *.X);;Cal3d binary Model (*.cmf *.CMF)"));
		}
	else{
		fn = filename;
		QString f_app = QFileInfo( QCoreApplication::arguments().at(0)).absolutePath() + "/" + filename;
		QString f_home = QDir::homePath() + "/.lumina/" + filename;
		if(QFileInfo (fn ).exists()){
	
			}
		else if(QFileInfo (f_app).exists()){
			fn = f_app;
			}	
		else if(QFileInfo (f_home).exists()){
			fn = f_home;
			}



		}

	if (fn.endsWith(".md2", Qt::CaseInsensitive)){
		importMD2(fn);
		}

	else if (fn.endsWith(".md3", Qt::CaseInsensitive)){
		importMD3(fn);
		}

	else if (fn.endsWith(".obj", Qt::CaseInsensitive)){
		importOBJ(fn);
		}

	else if (fn.endsWith(".3ds", Qt::CaseInsensitive)){
		import3DS(fn);
		}

	else if (fn.endsWith(".x", Qt::CaseInsensitive)){
		importX(fn);
		}

	else if (fn.endsWith(".cmf", Qt::CaseInsensitive)){
		importCMF(fn);
		}

	else if (fn.endsWith(".cr2", Qt::CaseInsensitive)){
		importCR2(fn);
		}

	};