-
Notifications
You must be signed in to change notification settings - Fork 922
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
scale spirals out of control when using the delta matrix #73
Comments
That's a serious issue! Can you please try to reproduce it with the sample app? |
I can reproduce this issue on a recent build. All my transforms are stored locally and every frame I calculate the absolute transform. Because of this, I used the delta matrix. Translation and rotation work properly but the scale in the delta matrix goes out of control |
I'll take a look very soon! Thanks |
I have a workaround for this one now. ImGuizmo::Manipulate(
&view.m[0][0],
&proj.m[0][0],
gizmoOperation,
gizmoMode,
&matrix.m[0][0],
&deltaMatrix.m[0][0],
currentSnap,
&transform->getBoundsMutable().m_LowerBounds.x);
matrix *= transform->getParentAbsoluteTransform().Invert();
transform->setTransform(matrix); The basic idea is that the |
@CedricGuillemet Any update on this? Having a similar issue on one of more recent builds (5a3afc9). Haven't really investigated the code, but what seems to be happening is that the delta matrix always contains a non-zero scale value, regardless of the scale gizmo being used or not. In my testing it returned a [1, 1, 1] scale despite me using the translation gizmo. I also made sure to check that it doesn't simply return the original scale, it still returned a [1, 1, 1] delta scale even when my transform matrix contained a [2, 2, 2] scale. So it always returns a [1, 1, 1] scale |
In fact it seems like the entire delta scale is very broken. Firstly the delta matrix will always have a scale of [1, 1, 1] when doing translation and rotation. Secondly when actually using the scale gizmo the delta matrix always contains a positive scale value, meaning the delta matrix can't be used for scaling down a transform, which seems strange to me, although it may be intended behaviour (if it is intended may I ask why?) |
Alright so now that I've investigated the code it's pretty obvious why the delta matrix always has a scale of [1, 1, 1] when doing translation or rotation. One potential solution to this could be for ImGuizmo to not copy the entire Unsure if that would work for rotation though so a better solution might be good. |
@CedricGuillemet So I realized that I was handling the delta scale incorrectly. Apparently the correct way of doing the delta scale is to multiply my original scale with the delta scale. |
When using the scale gizmo it somehow moves the object along with scaling it. This causes it to thrash until it jumps off screen.
The text was updated successfully, but these errors were encountered: