- update Assimp.net viewer application to take the model file to be loaded from the command line.
- add a screenshot to proof that it works ;-) - update Readme. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@848 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
5ded0698e1
commit
3b35d2216b
|
@ -183,16 +183,29 @@ namespace Assimp.Viewer
|
||||||
aiPostProcessSteps.aiProcess_SortByPType | // make 'clean' meshes which consist of a single typ of primitives
|
aiPostProcessSteps.aiProcess_SortByPType | // make 'clean' meshes which consist of a single typ of primitives
|
||||||
(aiPostProcessSteps)0);
|
(aiPostProcessSteps)0);
|
||||||
|
|
||||||
|
// default model
|
||||||
|
var path = "../../../../../../test/models/3DS/test1.3ds";
|
||||||
|
|
||||||
importer = new Importer();
|
importer = new Importer();
|
||||||
var path = "../../../../../../test/models/3DS/jeep1.3ds";
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
|
if (args.Length > 1) {
|
||||||
|
path = args[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//var path = "man.3ds";
|
//var path = "man.3ds";
|
||||||
scene = importer.ReadFile(path, flags);
|
scene = importer.ReadFile(path, flags);
|
||||||
if (scene != null) {
|
if (scene != null)
|
||||||
|
{
|
||||||
directory = Path.GetDirectoryName(path);
|
directory = Path.GetDirectoryName(path);
|
||||||
CacheMaterials(scene.mMaterials);
|
CacheMaterials(scene.mMaterials);
|
||||||
CacheMeshes(scene.mMeshes);
|
CacheMeshes(scene.mMeshes);
|
||||||
SetupCamera(scene.mCameras);
|
SetupCamera(scene.mCameras);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
MessageBox.Show("Failed to open file: " + path + ". Either Assimp screwed up or the path is not valid.");
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CacheMeshes(aiMeshVector meshes) {
|
private void CacheMeshes(aiMeshVector meshes) {
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 298 KiB |
|
@ -8,6 +8,10 @@ NOTE: This has only been tested on 32-bit Windows 7 in .NET 3.5SP1 compiled
|
||||||
under Visual Studio 2008 with the 'Debug' and 'Release' targets.
|
under Visual Studio 2008 with the 'Debug' and 'Release' targets.
|
||||||
|
|
||||||
|
|
||||||
|
The Viewer is very minimalistic, don't expect all files to be displayed
|
||||||
|
properly. Feel free to extend it ;-)
|
||||||
|
|
||||||
|
|
||||||
How To Build
|
How To Build
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue