• Advertisement
Sign in to follow this  

Assimp transformation matrices

This topic is 1089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey,

 

so I'm trying to load different models via Assimp, everything works well so far, but there's one thing I'm stuck with:

 

Assimp returns the whole scene, including a mesh list (vertices, etc.) and a tree containing references to the meshes and a transformation matrix. Now, what I want is the transformation, but in vectors. How do I do this?

 

I tried googling but it seems that no one has this problem, so am I doing something wrong?

 

Thanks in advance

Epi

Share this post


Link to post
Share on other sites
Advertisement


what I want is the transformation, but in vectors. How do I do this?

 

What kind of vectors? Or are you talking about quaternions?

 

If row- or column-vectors, load the matrix and create your own.

 

If quaternions, load the matrix and, using an appropriate math library, call QuaternionFromRotationMatrix or something similar.

Share this post


Link to post
Share on other sites

Oh no there's a decompose method in the matrix class, giving pretty much what I need. I guess I was just too tired.

 

For some reason all my googleing ended in threads which said something like extracting the transformation vectors from a matrix is kinda impossible.

Share this post


Link to post
Share on other sites

The decomposition is possible, but it is possible only if you got uniform scaling. If you got non-uniform scaling you better "bake" the transformations on your editor side, or alternatively bake them during import (i.e. pretransform your vertices). This is for the scene hierarchy of course, since Assimp's animation keys have quaternions. Are you aiming for a quaternion based rendering system ?

Share this post


Link to post
Share on other sites

At the moment I'm using 3 vectors for position, rotation and scaling, construct a matrix from them and render the stuff, but I was eventually going to use quaternions, so I might as well do that now, since I have to rewrite some stuff anyway.

 

Animations loaded via Assimp are planned as well, so that will work out just fine:)

 

Ill take care with the "baking", I believe I had this problem a while ago, using models of the internet.Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement