-
Notifications
You must be signed in to change notification settings - Fork 313
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
Incorrect result with non-uniform scale on axis not-aligned to local axis #981
Comments
@bghgary This issue highlight one behavior (with Max2021): switching to use the native decompose from max it give the correct scale and rotation values However, as you can see on the code above, the previous developper state that BTW the correct code appear to be
@Ben-Mack I'm agree this not solve the initial issue topic but I beleive we have no way to recompose the behavior and the intend of the scripting tools. You MAY add additional node as teapot parent which take the Z scale in account to act as global transform. |
Thank you for such quick investigation and the workaround! The maxscript I created is simplified just for reproduce purpose, unfortunately my actual case is not that simple, the 3D model provided by artist is already scaled in some arbitrary axis like that, so currently I have no way to know how it was scaled. Are there anyway to detect this kind of scaling? Can we noticed it from the transform matrix somehow? |
Nope i dont think so you can detect it, but i may be wrong, i do not know everyting about 3DSMax.
In other hand, the render engine in max is taking this in account, so it might be a way. |
Hey guy's,
give
[Note] there is an invert of the rotation beetwen max UI and SDK 1 & 3 are due to the fact we define the CoordSystem at the begining of the export session using DirectX (which is Babylon norm)
then
give
according in max coordinate system (as stated into the doc)
and
using so
finally
To be continued. |
@bghgary So the 3DS max transform matrix, when set into script, is logically build keeping the order of applied transform operations. Here for the particular case |
@bghgaryOn this case one proposal may be to save the matrix information into the BabylonMesh as ObjectTransformation, reset the node transform to identity, then "bake" the vertices with this matrix, additionally of the MaxOffset transformation. |
Just found some MaxSDK documentations that might help: World Space Modifiers and Object Transformations: INode Class Reference (see the parts about Transformation and Rotation: Seems like MaxSDK's document explains things in much more details than MXS document. |
This is the MaxScript to create a reproducable case:
Original obj in 3ds Max:
Exported result (I can see the z scale is applied to obj's local z axis):
Run resetXForm does help the exporter exported correctly, but in my case I needed this for instancing, and resetXForm will break instancing.
The text was updated successfully, but these errors were encountered: