-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
get position of ofxAssimpModelLoader mesh #2989
Comments
+1 |
I've allready made some code for getting the verticles. I still can't figure out how to get the position of the mesh:
|
This feels like it would be more appropriate in the forum, but in any case, @openframeworks/2d-3d, can you help? |
I presume that using the mean of the vertices isn't a solution I'm not familiar with Assimp, but if it's like ofMesh, then the mesh itself doesn't have a position, but the individual vertices do. Which means that your question can usually mean either: |
you need to get the matrix of the individual mesh from ofxAssimpModelLoader I exposed it in a branch here https://github.com/danthemellowman/openFrameworks/blob/ofxassimp-update-access-mesh-matrix/addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp#L827 but you can also just get the MeshHelper for a given mesh and get the matrix from that. |
You can also do something like this and get the bounding box of the mesh and then find the center point. https://github.com/YCAMInterlab/mapamok/blob/master/SharedCode/MeshUtils.h#L305 |
here is how ive been creating a duplicate mesh from a model and transforming it back into world space. you need to create a i do this quite a bit when working with ofxAssimpModelLoader and looks like others do too.
cc @ikillbombs @wasawi |
What if, ofxAssimpModelLoader, when importing the meshes, convert them to of3dPrimitive? |
Each node in ofxAssimp extends ofNode, ie meshes and bones. Meshes have both local and global bounding boxes and a center location. Functions have been added to get the transformed vertices as ofMeshes. openFrameworks/addons/ofxAssimp/src/ofxAssimpModel.h Lines 175 to 182 in 5b651b9
closed by #7776 |
Hi,
I'm trying to get a position of a mesh from Assimp. But I could not figure out how. Is there a simple solution for this? This could be a handy feature.
The text was updated successfully, but these errors were encountered: