-
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
Missing a nice main.cpp example? #21
Comments
I'm working on it :) |
Yes, and can u make better comments? There are functions without any help (ex: SetRect). Im not sure about how to use this.... |
I would really appreciate a small example that works on its own. I currently cannot get ImGuizmo to draw anything and I'm not sure whether it is because of the view/projection matrices or because I call the functions in the wrong order.
right after |
Hi Fabian,
Can you dump the view & projection matrices?
I don't see anything strange in your code.
best
Cedric
…On Fri, May 26, 2017 at 3:22 AM, Fabian Löschner ***@***.***> wrote:
I would really appreciate a small example that works on its own. I
currently cannot get ImGuizmo to draw anything and I'm not sure whether it
is because of the view/projection matrices or because I call the functions
in the wrong order.
At the moment I call
ImGuizmo::BeginFrame();
ImGuizmo::Enable(true);
ImGuiIO& io = ImGui::GetIO();
ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);
glm::fmat4 view = m_camera->modelViewMatrix();
glm::fmat4 projection = m_camera->projectionMatrix();
ImGuizmo::DrawCube(&view[0][0], &projection[0][0], &matrix[0][0]);
ImGuizmo::Manipulate(&view[0][0], &projection[0][0], ImGuizmo::ROTATE, ImGuizmo::WORLD, &matrix[0][0]);
right after ImGuiGlfw3NewFrame() in the render loop but nothing is drawn.
The matrix variable is initialized to the identity matrix and I tried to
supply my real view and projection matrices as well as identity matrices.
Standard ImGui windows are drawn correctly btw. Do you have any advice?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQIyO09-lHm4NJOTvhnEufN2eoCbognks5r9qfYgaJpZM4LdUI6>
.
--
Cedric Guillemet
http://www.skaven.fr http://twitter.com/skaven_
|
Thanks for the reply, I use the following code to compute the matrices: void Camera::updateModelViewMatrix()
{
m_modelView = glm::scale(glm::dmat4(), m_scaling);
m_modelView = glm::rotate(m_modelView, glm::angle(m_rotation), glm::axis(m_rotation));
}
void Camera::updateProjectionMatrix()
{
const double diag = std::hypot(m_viewportSize.x, m_viewportSize.y);
m_projection = glm::ortho<double>(-0.5*m_viewportSize.x*m_zoom, 0.5*m_viewportSize.x*m_zoom, -0.5*m_viewportSize.y*m_zoom, 0.5*m_viewportSize.y*m_zoom, -diag, diag);
} |
please add a main.cpp |
added mine with object picker http://www.github.com/edselmalasig/ImGuizmo_pick_and_choose |
@CedricGuillemet, I found the problem why nothing was drawn: In my call
I forgot to initialize |
No description provided.
The text was updated successfully, but these errors were encountered: