-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix transformations not applied #14
base: master
Are you sure you want to change the base?
Fix transformations not applied #14
Conversation
By default (i.e. if no translation, rotation, or scale are specified) it returns the identity. This module is the one that needed Three.js (to simplify affine matrix computations).
The default of trsMatrix is the identity anyway.
@flozz will this PR be reviewed? Is this project still being maintained? Otherwise my organization could publish this fixed version on |
@@ -63,6 +63,7 @@ | |||
}, | |||
"dependencies": { | |||
"lodash": "^4.17.5", | |||
"matrixmath": "^2.2.2" | |||
"matrixmath": "^2.2.2", | |||
"three": "^0.103.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late answer !
We don't want to depend on a specific engine like Three, especially as we usually work with Babylonjs. I saw that three was used only in trs-matrix.js
to break down matrices. Is it possible to implement functions like multiply, or quaternions in the lib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see three options:
- writing a small implementation of affine transformation matrices, but that could be wasted time given that many tested implementations already exist.
- using a lightweight library that provides affine transformations but does not interfere with babylon, three and others.
- providing an option to the user to pass his preferred implementation of affine matrices, given a specification of what API is expected; this would most likely require the user to build an adapter class for the library he is using, since they are all different.
Personally I would prefer the second option, but I haven't been able to find a library like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know https://github.com/toji/gl-matrix develop by Tojiro (but I nevers used it), well know and tested library, feel free to take a look !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you were using it and it seemed ok, but the API looked a bit weird to me.
I'll try converting to using that when I have some time.
This PR fixes #12.
It contains also some tests for glb2 files.
I could not test gltf1 files because I don't have a way to create them, but the implementation is the same one, so it should be ok.