jkvargas / russimp

Assimp bindings for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AABB seems broken

virtualritz opened this issue · comments

I tried a simple example loading an OBJ.
The AABB is always zero (all coordinates of min & max are zero). Haven't dug into this, just documenting this.

hey dude,
can you share a simplest possible file with that issue?
would be nice to add a test to make sure that this will be working in the future.

Yeah, prepped my fork yesterday for that by adding Scene::from_buffer() so the input file can be included in the source. I hope I get to it before the weekend.

Everything is in the assimp-sys branch of my russimp fork

There is a bounding_box() test in scene.rs that currently fails (demonstrates the issue with three lines of code).

hey dude,
so just to close this issue,

I made a small app here just to test this out directly from assimp.

std::string content = "o T\nv  1  1  1\nv  1 -1 -1\nv -1  1 -1\nv -1 -1  1\nf 1 2 3\nf 1 3 4\nf 1 4 2\nf 2 4 3\n";

auto* scene = importer.ReadFileFromMemory(content.c_str(), content.length(), aiProcess_CalcTangentSpace       |
                                                                             aiProcess_Triangulate            |
                                                                             aiProcess_JoinIdenticalVertices  |
                                                                             aiProcess_SortByPType);
std::cout << "max_x: " << scene->mMeshes[0]->mAABB.mMax.x << std::endl;
std::cout << "max_y: " << scene->mMeshes[0]->mAABB.mMax.y << std::endl;
std::cout << "max_z: " << scene->mMeshes[0]->mAABB.mMax.z << std::endl;
std::cout << "min_x: " << scene->mMeshes[0]->mAABB.mMin.x << std::endl;
std::cout << "min_y: " << scene->mMeshes[0]->mAABB.mMin.y << std::endl;
std::cout << "min_z: " << scene->mMeshes[0]->mAABB.mMin.z << std::endl;`

This is outputting:

max_x: 0
max_y: 0
max_z: 0
min_x: 0
min_y: 0
min_z: 0

I suppose that's an issue with them. =)