Closed GeoSpark closed 4 months ago
Well done for noticing this! The way I had the 'ortho_bl' and 'ortho_tr' set in morph::Visual (to (-4,-4) and (4,4)) meant that the projection looked ok, despite the error.
I think fix is slightly different from what you wrote down. I think because the 'tr' and 'bl' names for those coordinates was confusing - I've changed them to rt and bl so that rt[0] is 'r' and rt[1] is 't'. Do you agree with my PR? https://github.com/ABRG-Models/morphologica/pull/191/commits
It certainly confused me for a good hour or so! I do prefer that naming convention, but then you should also rename ortho_bl
and ortho_tr
in Visual.h
I'll do that and add to the PR
Presumably you figured out how to view the orthographic projection? Run any morphologica example program and press "Ctrl-y" to cycle from perspective projection to orthographic (press it once more and you'll get a hacky, incomplete, but fun cylindrical projection. It's back to perspective with a third press of Ctrl-y.)
Lastly - what motivated you to examine the orthographic projection code? I'd be interested to know. I don't use this projection much in my own work; I pretty much always have my programs produce the perspective projection. Do you have an interest in orthographic visualisation?
I was looking for a visualisation library that worked with Qt for displaying 2D gridded archaeological geophysics data, and also one that can do some basic charting, and I stumbled across morphologica. I wanted the gridded data to appear 2D when viewed normally, but with the option of 3D after some processing. It all worked fine but because it generates a 3D mesh, perspective effects were visible in the viewport. I've ended up making a copy of viswidget.h
so I can mess about with my own functionality, such as modifying the keybinds, and calculating ortho viewport size based on zoom and aspect ratio.
Thanks for sharing that information. Glad it's potentially of use for your work. To avoid perspective effects you could maybe toggle the z values for your grid when viewing 2d, possibly doing this automatically based on the rotational state in morph::Visual. I was also thinking about the ortho projection and thought it would be good to map the mouse wheel to scale ortho_tr and ortho_lb to make it possible to zoom in ortho view
The code looks like this:
But it should look like this: