检测 3D 文件的格式

检测格式编程示例

此源代码说明了如何检测文件格式 (使用文件路径或流) 并检查其扩展名。

// the path to the documents directory.
String MyDir = RunExamples.getDataDir();
// detect format of 3D file
FileFormat inputFormat = FileFormat.detect(MyDir + "document.fbx");
// display the file format
System.out.println("File Format: " + inputFormat.toString());