Détecter le format du fichier 3D

Détecter l’échantillon de programmation de format

Ce code source illustre comment détecter le format de fichier (à l’aide du chemin de fichier ou du flux) et vérifier son extension.

// 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());