mosra / magnum-bootstrap

Bootstrap projects for the Magnum C++11 graphics engine
https://magnum.graphics/
The Unlicense
92 stars 37 forks source link

magnum + wxWidgets sample projects, mouse drag can rotate the camera, but not as expected #27

Open asmwarrior opened 3 years ago

asmwarrior commented 3 years ago

Hi, I try to implement a magnum + wxWidgets sample C++ projects by using the msys2.

I just copy and modify the code:

https://github.com/mosra/magnum-examples/blob/master/src/mouseinteraction/MouseInteractionExample.cpp

Since it use the SDL as the main GUI, I just translated all the GUI related code to wxWidgets, the main GUI shows correctly, but I found an issue that the mouse drag can rotate the camera/scene, but not as expected as the webgl one shown in the Mouse In­ter­ac­tion Ex­am­ple, can any one help me.

I'm not quite understand how the matrix calculation works for the mouseinteraction example project.

My project is in https://github.com/asmwarrior/magnum-wx

Thanks.

asmwarrior commented 3 years ago

rotation_error

I have upload the screen cast gif of the rotation, I just use the left key drag horizontally.

Note that the code is 1:1 map from the code: MouseInteractionExample.cpp

The expect behavior is that the rotation should around the center of the triangle (the origin point (0,0,0))