-
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
Coordinate system requirements #22
Comments
Hi Madeesh,
No, ImGuizmo is matrix/ coordinate system agnostic. It doesn't recompute
view/proj matrix and solely depends on what user gives.
If you have a self containing VC project, I can have a look.
…On Tue, Feb 21, 2017 at 3:37 PM, Madeesh Kannan ***@***.***> wrote:
Is ImGuizmo depend on a particular coordinate system? I'm trying to
retrofit a 3D editor with ImGuizmo, one that is based on Dx9+Gamebryo.
Gamebryo's coordinate system, for some reason, is different from the usual
left-hand/right-hand systems :
- The Up vector is in +Y
- The Right vector is in +Z
- The Forward vector is in +X
Unfortunately, using the view/perspective matrices of that coordinate
system renders the gizmo incorrectly (it appears along the negative
vertical axis and gets culled on the slightest movement of the camera). How
would I go about resolving this issue? The gizmo does work with a regular
LH coordinate system (tested it in a demo DirectX project).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#22>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABQIyBJcIWqk-rF_ay8KobSgWP1fW4V6ks5reva_gaJpZM4MHZSP>
.
--
Cedric Guillemet
http://www.skaven.fr http://twitter.com/skaven_
|
Hey @CedricGuillemet, i am also facing same issue trying to integrate ImGuizmo into AtomicGameEngine. Engine uses following coordinate system:
I have a self-contained testcase, although it is pretty fat as repository pulls in entire engine. If offer still stands you may take a look: https://github.com/rokups/CSGBoolOpsTest (do not forget to clone submodules). Engine has all dependencies bundled and you should not need to do anything else than running plain In "Debug" window try adjusting z component of translation. Gizmo can be visible right in the center although it looks weird. Holding right mouse button and moving camera tiny bit makes gizmo move to opposite direction. Besides, shouldnt gizmo be always visible as long as |
After some thought it occurred to me that there may be several different matrix conventions and actually that is the case. ImGuizmo is using row convention where opengl uses column convention. So matrix has to be converted using these: void ToImGuizmo(float* dest, const Matrix4& src)
{
for (auto row = 0; row < 4; row++)
{
for (auto col = 0; col < 4; col++)
dest[row * 4 + col] = src.Data()[col * 4 + row];
}
}
void FromImGuizmo(Matrix4& dest, float* src)
{
for (auto row = 0; row < 4; row++)
{
for (auto col = 0; col < 4; col++)
(&dest.m00_)[col * 4 + row] = src[row * 4 + col];
}
}
|
@rokups Thanks for the code. Unfortunately, switching between row-major and column-major matrices doesn't help in my setup. |
Is ImGuizmo depend on a particular coordinate system? I'm trying to retrofit a 3D editor with ImGuizmo, one that is based on Dx9+Gamebryo. Gamebryo's coordinate system, for some reason, is different from the usual left-hand/right-hand systems :
Unfortunately, using the view/perspective matrices of that coordinate system renders the gizmo incorrectly (it appears along the negative vertical axis and gets culled on the slightest movement of the camera). How would I go about resolving this issue? The gizmo does work with a regular LH coordinate system (tested it in a demo DirectX project).
The text was updated successfully, but these errors were encountered: