Git Product home page Git Product logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
[deleted comment]

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
There seems to be a discrepancy in Decompose from Assimp's source - I need to 
dive deeper into this. It looks like a confusion of row-vs-column vector 
ordering.

Have you tried the static decompose method exposed in AssimpMethods (in 
Assimp.Unmanaged namespace)? Does it give the same result?

Also, do you mind supplying some test input?

Original comment by nicholas.woodfield on 2 Nov 2012 at 12:47

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
I also had this problem, the decompose() function of Assimp.Net gave me very 
strange results. By copying the Assimp.Net matrix into a Mogre matrix (I use 
the Mogre library for rendering) and decomposing it using Mogre I finally got 
the expected result.

Original comment by [email protected] on 2 Nov 2012 at 1:56

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
ok.. i have been looking into this more.. this is what i got :

1) I tried Assimp.Unmanaged.AssimpMethods.DecomposeMatrix and it does not work.

2) a simple way you could try to reproduce this is by decomposing and 
re-composing the offset matrix and see if it work. for example :

Vector3D scale, pos;
Quaternion quat;

var m = aibone.OffsetMatrix;

m.Decompose(out scale, out quat, out pos);
var new_m = Matrix4x4.FromScaling(scale) * new Matrix4x4(quat.GetMatrix()) * 
Matrix4x4.FromTranslation(pos);

When you try to use new_m instead of m the result are wrong.


3) I also attach the mesh that i use for testing ( good old bob ).


4) I did a test where i take the matrix and decompose it with both Assimp and 
SharpDX to examine the differences in the results. They both seem to agree in 
the scale and translation , but they differ in the rotation quaternion !!





Original comment by [email protected] on 2 Nov 2012 at 9:38

Attachments:

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
Thanks,

Alright, I think I got to the bottom of this. There were several 
inconsistencies with converting between quaternions/matrices which seemed to be 
causing the issue in Decompose.

I also added some extra documentation for assumptions on matrix order. Note 
that Assimp (and by extension, AssimpNet) use row-major, column-vector 
matrices. APIs such as SharpDX/XNA/SlimDX (and apparently OpenTK) use 
row-major, row-vector matrices, so make sure when you convert from an Assimp 
Matrix you first transpose it. Personally, I prefer row vector matrices and 
tend to use them more often. I would recommend always using the Math library of 
your graphics API though, the AssimpNet math structures really are only the 
bare minimum.

Also worth to note, that SRT order for column vector matrices would be TRS, but 
the matrix multiplication method for Matrix3x3 and Matrix4x4 are BxA rather 
than AxB. As I said, I added documentation to highlight this (for myself, 
especially).

The changes are in r50, I'll keep the ticket open a while longer if there are 
still issues (math inconsistencies are always a pain!).


Original comment by nicholas.woodfield on 4 Nov 2012 at 7:13

  • Changed state: Started

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
That's good .. and i agree that you should always copy the matrix to your 
graphics API and use it there , something you are bound to do anyway down the 
road.


What bothers me though is this:

1) i was using assimp's decompose before (v2.x) and it worked fine (and with 
SharpDX). So unless they changed the matrix ordering from one version to the 
next (unlikely) something else must be wrong.

2) The results of the Decomposing are matrix-order-indepented . That means that 
if i use assimp.net decompose function on an assimp.net matrix , the scale 
quaternion and translation i get back should be the same as if i decompose a 
matrix in sharpdx/slimdx/...


I am not really using the decompose function anymore , but i still think 
someone might.

Thanks :)

Original comment by [email protected] on 4 Nov 2012 at 10:13

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
Oh, my apologies. I thought the commit you made was for documentation only, i 
didn't realized you had fixes.

I just checked out the r50 and gave it a try. it seems to behave correct now :)

Original comment by [email protected] on 4 Nov 2012 at 10:39

from assimp-net.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
Excellent, closing the ticket

Original comment by nicholas.woodfield on 4 Nov 2012 at 5:50

  • Changed state: Fixed

from assimp-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.