mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2025-03-03 06:51:43 -05:00
Added a unit test
This commit is contained in:
parent
29fa71fe2b
commit
ddd99ea33d
302
specs/data/BoxTextured/BoxTextured.gltf
Normal file
302
specs/data/BoxTextured/BoxTextured.gltf
Normal file
File diff suppressed because one or more lines are too long
13
specs/data/BoxTextured/BoxTextured.mtl
Normal file
13
specs/data/BoxTextured/BoxTextured.mtl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Blender MTL File: 'BoxTextured.blend'
|
||||||
|
# Material Count: 1
|
||||||
|
|
||||||
|
newmtl Textured
|
||||||
|
Ns 96.078431
|
||||||
|
Ka 1.000000 1.000000 1.000000
|
||||||
|
Kd 0.640000 0.640000 0.640000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ke 0.000000 0.000000 0.000000
|
||||||
|
Ni 1.000000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
||||||
|
map_Kd CesiumLogoFlat.png
|
46
specs/data/BoxTextured/BoxTextured.obj
Normal file
46
specs/data/BoxTextured/BoxTextured.obj
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# Blender v2.77 (sub 0) OBJ File: 'BoxTextured.blend'
|
||||||
|
# www.blender.org
|
||||||
|
mtllib BoxTextured.mtl
|
||||||
|
o Cube_Cube.001
|
||||||
|
v -1.000000 -1.000000 1.000000
|
||||||
|
v -1.000000 1.000000 1.000000
|
||||||
|
v -1.000000 -1.000000 -1.000000
|
||||||
|
v -1.000000 1.000000 -1.000000
|
||||||
|
v 1.000000 -1.000000 1.000000
|
||||||
|
v 1.000000 1.000000 1.000000
|
||||||
|
v 1.000000 -1.000000 -1.000000
|
||||||
|
v 1.000000 1.000000 -1.000000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vt 0.0000 0.0000
|
||||||
|
vt 1.0000 0.0000
|
||||||
|
vt 1.0000 1.0000
|
||||||
|
vt 0.0000 1.0000
|
||||||
|
vn -1.0000 0.0000 0.0000
|
||||||
|
vn 0.0000 0.0000 -1.0000
|
||||||
|
vn 1.0000 0.0000 0.0000
|
||||||
|
vn 0.0000 0.0000 1.0000
|
||||||
|
vn 0.0000 -1.0000 0.0000
|
||||||
|
vn 0.0000 1.0000 0.0000
|
||||||
|
usemtl Textured
|
||||||
|
s off
|
||||||
|
f 2/1/1 4/2/1 3/3/1 1/4/1
|
||||||
|
f 4/5/2 8/6/2 7/7/2 3/8/2
|
||||||
|
f 8/9/3 6/10/3 5/11/3 7/12/3
|
||||||
|
f 6/13/4 2/14/4 1/15/4 5/16/4
|
||||||
|
f 1/17/5 3/18/5 7/7/5 5/16/5
|
||||||
|
f 6/13/6 8/6/6 4/19/6 2/20/6
|
BIN
specs/data/BoxTextured/CesiumLogoFlat.png
Normal file
BIN
specs/data/BoxTextured/CesiumLogoFlat.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
20
specs/lib/convertSpec.js
Normal file
20
specs/lib/convertSpec.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
'use strict';
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
var convert = require('../../lib/convert');
|
||||||
|
|
||||||
|
var objFile = './specs/data/BoxTextured/BoxTextured.obj';
|
||||||
|
var gltfFile = './specs/data/BoxTextured/BoxTextured.gltf';
|
||||||
|
|
||||||
|
describe('convert', function() {
|
||||||
|
it('converts an obj to gltf', function(done) {
|
||||||
|
var spy = spyOn(fs, 'writeFile').and.callFake(function(file, data, callback) {
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
|
||||||
|
convert(objFile, gltfFile, {}, function() {
|
||||||
|
expect(path.normalize(spy.calls.first().args[0])).toEqual(path.normalize(gltfFile));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user