Add textured rectangle test object.
This commit is contained in:
parent
c4782710ad
commit
77edb8520d
5
test/testfiles/obj/rectangle_with_texture.mtl
Normal file
5
test/testfiles/obj/rectangle_with_texture.mtl
Normal file
@ -0,0 +1,5 @@
|
||||
newmtl Material
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 1.000000 1.000000 1.000000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
map_Kd texture.png
|
||||
15
test/testfiles/obj/rectangle_with_texture.obj
Normal file
15
test/testfiles/obj/rectangle_with_texture.obj
Normal file
@ -0,0 +1,15 @@
|
||||
mtllib rectangle_with_texture.mtl
|
||||
|
||||
v 0.0 0.0 0.0
|
||||
v 1.0 0.0 0.0
|
||||
v 1.0 1.0 0.0
|
||||
v 0.0 1.0 0.0
|
||||
vn 0.0 0.0 1.0
|
||||
vt 0.0 0.0
|
||||
vt 1.0 0.0
|
||||
vt 1.0 1.0
|
||||
vt 0.0 1.0
|
||||
|
||||
o Mesh
|
||||
usemtl Material
|
||||
f 1/1/1 2/2/1 3/3/1 4/4/1
|
||||
BIN
test/testfiles/obj/texture.png
Normal file
BIN
test/testfiles/obj/texture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@ -374,6 +374,36 @@ describe ('Obj Importer', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it ('rectangle_with_texture.obj', function () {
|
||||
var model = testFiles.ImportObjFile ('rectangle_with_texture.obj');
|
||||
assert (OV.CheckModel (model));
|
||||
assert.deepStrictEqual (testUtils.ModelToObject (model), {
|
||||
name : '',
|
||||
materials : [
|
||||
{ name : 'Material' }
|
||||
],
|
||||
meshes : [
|
||||
{
|
||||
name : 'Mesh',
|
||||
triangles : [
|
||||
{
|
||||
vertices : [0, 0, 0, 1, 0, 0, 1, 1, 0],
|
||||
normals : [0, 0, 1, 0, 0, 1, 0, 0, 1],
|
||||
uvs : [0, 0, 1, 0, 1, 1],
|
||||
mat : 0
|
||||
},
|
||||
{
|
||||
vertices : [0, 0, 0, 1, 1, 0, 0, 1, 0],
|
||||
normals : [0, 0, 1, 0, 0, 1, 0, 0, 1],
|
||||
uvs : [0, 0, 1, 1, 0, 1],
|
||||
mat : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
it ('cube_with_materials.obj', function () {
|
||||
var model = testFiles.ImportObjFile ('cube_with_materials.obj');
|
||||
assert (OV.CheckModel (model));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user