Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofxAssimpModelLoader getMesh doesn't apply matrix transformation #7303

Closed
dimitre opened this issue Feb 7, 2023 · 5 comments
Closed

ofxAssimpModelLoader getMesh doesn't apply matrix transformation #7303

dimitre opened this issue Feb 7, 2023 · 5 comments

Comments

@dimitre
Copy link
Member

dimitre commented Feb 7, 2023

when I'm using ofxAssimpModelLoader object vs. drawing the meshes with getMesh they don't have the same position / scale.
Reading the code a bit I suppose there is a global transformation matrix and another for each mesh that it applies when drawing ofxAssimpModelLoader object.
Should getMesh output the mesh with the matrixes applied?

@ofTheo
Copy link
Member

ofTheo commented Feb 7, 2023

Hey @dimitre - yes that is correct and I believe intended behavior.
It returns the mesh data without the transformations.

I was also thinking though that it might be good to have getTransformedMesh or something like that.

There is quite a bit of work to do with ofxAssimpModelLoader now that all the PBR and latest assimp fixes are in but we should look into some more helper features ( saving too! ).

@dimitre
Copy link
Member Author

dimitre commented Feb 7, 2023

Great. yeah it would be nice to have getTransformedMesh!
I'll be trying to implement setSpeed for animations. from what I've seen it should be easy to do.

@ofTheo
Copy link
Member

ofTheo commented Feb 7, 2023

Awesome! Yeah, any improvements to the addon would be great. 👍
Its fairly janky at the moment and probably needs a big rewrite, but any robust bug fixes or features would be awesome.

@NickHardeman
Copy link
Contributor

The new ofxAssimp add-on has functions for the original mesh

/// \brief Get an OF mesh based on name of assimp mesh.
/// \param aname name of the desired assimp mesh.
/// \return ofMesh that is not transformed.
ofMesh& getOFMeshForMesh(const std::string& aname);
/// \brief Get an OF mesh based on the vector index of the assimp mesh.
/// \param ameshIndex vector index of the assimp mesh.
/// \return ofMesh that is not transformed.
ofMesh& getOFMeshForMesh(unsigned int ameshIndex);

or getting the OF mesh transformed by the bones and animations

/// \brief Get a transformed OF mesh based on name of assimp mesh.
/// \param aname name of the desired assimp mesh.
/// \return Transformed ofMesh.
ofMesh getTransformedOFMeshForMesh(const std::string& aname);
/// \brief Get a transformed OF mesh based on the vector index of the assimp mesh.
/// \param ameshIndex vector index of the assimp mesh.
/// \return Transformed ofMesh.
ofMesh getTransformedOFMeshForMesh(unsigned int ameshIndex);

@NickHardeman
Copy link
Contributor

closed by #7776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants