Closed eliaperantoni closed 3 years ago
That is great mate. Thanks so much for contributing. Do you think you can add a test to covert this issue? Maybe you can add you obj to models folder :) Also, would you mind to raise the version in Cargo.toml as well? Thanks in advance.
Certainly! Here it is.
thanks a lot, man!
Hello!
I started using this crate but I noticed that
Mesh::texture_coords
contains all 8 possible UV channels but only the first set of coordinates for each.But the Assimp docs say that, for each UV channel, there are
mNumVertices
sets of texture coordinates, not just one.For example: I have a cube and this is what
dbg!(&mesh.texture_coords)
prints:While the
.obj
contains 14 coordinates:As you can see, only the first row is available from Russimp.
They are expanded to 24 coordinates once loaded by Assimp because I'm using triangulation (I think). Anyways the same thing happens in C++
This PR aims to fix this by making the
texture_coordinates
aVec<Option<Vec<Vector3D>>>
.I did some testing with a .obj cube. On the left are the texture coordinates on UV channel 0 according to Russimp (with this PR applied) and on the right is the C++ version using pure Assimp.
Hope I did follow the style guide of the repo! I tried to do it as cleanly as possible but I'm still quite the noob at Rust.
Let me know what you think and thank you for providing this crate!