Add textured rectangle test object.

This commit is contained in:
Viktor Kovacs 2021-03-29 08:23:48 +02:00
parent c4782710ad
commit 77edb8520d
4 changed files with 50 additions and 0 deletions

View 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

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -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));