diff --git a/test/testfiles/3ds/cube.png b/test/testfiles/3ds/cube.png new file mode 100644 index 0000000..768f7e4 Binary files /dev/null and b/test/testfiles/3ds/cube.png differ diff --git a/test/testfiles/3ds/cube_hierarchy.3ds b/test/testfiles/3ds/cube_hierarchy.3ds new file mode 100644 index 0000000..15263ee Binary files /dev/null and b/test/testfiles/3ds/cube_hierarchy.3ds differ diff --git a/test/tests/importer3ds_test.js b/test/tests/importer3ds_test.js index 8d1f5fe..48d58a8 100644 --- a/test/tests/importer3ds_test.js +++ b/test/tests/importer3ds_test.js @@ -97,7 +97,7 @@ describe ('3ds Importer', function() { min : [2, 0, 0], max : [3, 1, 1] } - } + } ] }); done (); @@ -160,10 +160,87 @@ describe ('3ds Importer', function() { min : [0, 2, 0], max : [1, 3, 1] } - } + } ] }); done (); }); - }); + }); + + it ('cube_hierarchy.3ds', function (done) { + testFiles.Import3dsFile ('cube_hierarchy.3ds', function (model) { + assert (OV.CheckModel (model)); + assert.deepStrictEqual (testUtils.ModelToObjectSimple (model), { + name: '', + materials: [ { name: 'c_tex' }, { name: 'c_red' }, { name: 'c_blue' } ], + meshes: [ + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ -1, -1, -1 ], max: [ 1, 1, 1 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ 2, -1, -1 ], max: [ 4, 1, 1 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ 2, 2, -1 ], max: [ 4, 4, 1 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ -1, 2, -1 ], max: [ 1, 4, 1 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ -1, -1, 2 ], max: [ 1, 1, 4 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ 2, -1, 2 ], max: [ 4, 1, 4 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ 2, 2, 2 ], max: [ 4, 4, 4 ] } + }, + { + name: 'Cube', + vertexCount: 8, + normalCount: 12, + uvCount: 8, + triangleCount: 12, + boundingBox: { min: [ -1, 2, 2 ], max: [ 1, 4, 4 ] } + } + ] + }); + done (); + }); + }); });