zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
114 stars 22 forks source link

Ortho view rotation does an inversion??? #144

Open m-7761 opened 3 years ago

m-7761 commented 3 years ago

I can't figure this one out, but if you take the ortho view and start rotating it up/down you'll see that it will eventually kind of stop and start going backward and then straighten itself out and return to normal.

For some reason it's easier to do it in the vertical direction but if you have an arbitrary view sometimes it can happen with the horizontal direction.

The code in ModelViewport::rotateViewport seems unnecessarily elaborate. Maybe there's something in there. Maybe it's like a gimbal lock thing. It's pretty weird. Just putting this out there in case anyone gets to the bottom of it.

m-7761 commented 3 years ago

I don't know how but I seem to have fixed this inadvertently at some point, that had to have been pretty recently (since I filed this report.)

My code is at https://github.com/mick-p1982/mm3d/blob/widgets95-ui/src/mm3dcore/modelviewport.cc and there is a runtime boolean constant called modelviewport_drawing_view that switches to drawing with the same matrix the "tools" use instead of reconstructing it, but the bug is solved with this change off and on, so I'm not sure what did it. (The current code has it set to 0 but I meant to set it 1 before uploading.)