diff --git a/neo/renderer/Model_gltf.cpp b/neo/renderer/Model_gltf.cpp index 4b89e622..401b9e20 100644 --- a/neo/renderer/Model_gltf.cpp +++ b/neo/renderer/Model_gltf.cpp @@ -19,11 +19,11 @@ bool idRenderModelStatic::ConvertGltfMeshToModelsurfaces( const gltfMesh* mesh ) void MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh* _mesh, gltfData* data ) { - for( auto* gltfMesh : data->MeshList( ) ) + //for( auto* gltfMesh : data->MeshList( ) ) { - for( auto prim : gltfMesh->primitives ) + for( auto prim : _mesh->primitives ) { - common->Printf( "primitive for %s\n", gltfMesh->name.c_str() ); + common->Printf( "primitive for %s\n", _mesh->name.c_str() ); gltfAccessor* accessor = data->AccessorList( )[prim->indices]; gltfBufferView* bv = data->BufferViewList( )[accessor->bufferView]; @@ -47,7 +47,7 @@ void MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh* _mesh, gltfData* data for( int i = 0; i < accessor->count; i += 3 ) { - MapPolygon& polygon = polygons.Alloc( ); + MapPolygon& polygon = polygons.Alloc(); polygon.SetMaterial( "textures/enpro/enwall16" ); polygon.AddIndex( indices[i + 0] ); polygon.AddIndex( indices[i + 1] ); @@ -77,6 +77,7 @@ void MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh* _mesh, gltfData* data { case gltfMesh_Primitive_Attribute::Type::Position: { + //for( int i = attrAcc->count - 1; i >= 0; i-- ) for( int i = 0; i < attrAcc->count; i++ ) { idVec3 pos; diff --git a/neo/tools/compilers/dmap/map.cpp b/neo/tools/compilers/dmap/map.cpp index bf210d35..f6f60930 100644 --- a/neo/tools/compilers/dmap/map.cpp +++ b/neo/tools/compilers/dmap/map.cpp @@ -501,6 +501,15 @@ static int ParsePolygonMesh( const MapPolygonMesh* mesh, int primitiveNum, int n tri->v[1] = verts[ indexes[ 1 ] ]; tri->v[2] = verts[ indexes[ 2 ] ]; +#if 0 + idLib::Printf( "indices: ( %i %i %i )\n", indexes[ 0 ], indexes[ 1 ], indexes[ 2 ] ); + + idLib::Printf( "verts: ( %i %i %i ) ( %i %i %i ) ( %i %i %i )\n", + int( tri->v[0].xyz.x ), int( tri->v[0].xyz.y ), int( tri->v[0].xyz.z ), + int( tri->v[1].xyz.x ), int( tri->v[1].xyz.y ), int( tri->v[1].xyz.z ), + int( tri->v[2].xyz.x ), int( tri->v[2].xyz.y ), int( tri->v[2].xyz.z ) ); +#endif + idPlane plane; plane.FromPoints( tri->v[0].xyz, tri->v[1].xyz, tri->v[2].xyz );