Google Summer of Code 2019, with OSGeo (The Open Source Geospatial Fundation)
QGIS 3D Improvement: On Screen Navigation, Bookmarks, Rendering Point Feature as Billboard, and Measuring Tool
QGIS 3D is a great feature that has been introduced in QGIS 3.0 in 2018. It is still missing some features that are needed or can be helpful for the user though. In this project, I will work on 4 improvements to fill that missing features:
- On Screen Navigation: help the user to navigate the 3D view
- Measuring Tool: measure distance in 3D view
- Rendering Point Feature as Billboard: show a point feature as a billboard (use case: show icon location and point cloud rendering)
- Bookmarks: help the user to save a 3D view and/or go back to a saved 3D view
Before GSoC 2019
- It's possible to navigate in 3D Map View by using mouse or keyboard. It's quite easy to do it, unless you are not familiar about it. Just like me. It's easy to get lost and confused. You are not sure which key or movement to zoom, tilt, pan, or rotate the map view.
- There is no way to do measurement in 3D Map view.
- There is no billboard rendering support for point in 3D.
- There is no bookmark feature to save a specific scene in 3D map view. There is only reset view which set the view from the top.
My Summer (and before) Story with GSoC?
All is started in Febuary, I was thinking to apply for GSoC 2019. I approach some of QGIS core developers, and things went to QGIS 3D. I attended QGIS Hackfest in A Coruna, Spain to discuss more about my proposal with my future mentor, Martin Dobias. We came up with some features that I can work in the GSoC project. Here are the features that I worked on the project.
3D On-Screen Navigation
Martin suggested me to start working on a separate project to make the iteration faster. I worked initially in this repository to implement on-screen navigation. Things went well, except that it's not possible to create a floating widget on top of Q3DWindow. The alternative implementation is adding the QWidget for the navigation next to the 3D Map View. Other alternative solution is either too much work (render the navigation manually) or adding new dependency into QGIS (using QtQuick). The tool is accessible from the 3D Map View toolbar.Result: On-Screen navigation is added with these features: zoom in and out, pan, rotate with a compas-like widget, tilt up and down. It will be released in QGIS 3.10.
3D Measurement Tool
The first obstacle is the line rendering (it does not show up, and I learned that it is not so easy to debug missing thing in 3D). I got help for this one in this commit.
I tried implementing the 3D measurement tool as in 2D as much as possible. It has the same UI with the same configuration (rubber band color, unit, decimal place, and keeping the base unit). It also has the same behavior (left-click to add a new point, middle-click to delete the last point, and right-click to restart the measurement). The main difference compared to the 2D one is this tool considers the Z-value, for example, it will pick the height of an object or the wall of a building. In this case, the user can measure for example the height of a tree or the distance between the top of two building. The tool is available in the 3D Map view toolbar.Result: 3D Measurement Tool is added to QGIS 3.10.
3D Rendering Point Feature as A Billboard
After it is working, I moved it to the QGIS code base. It is not straight forward process, and has some obstacles. In the end, I can make it work and now we can use the billboard rendering for a point in 3D map view. The billboard can be set using the same QGIS symbol for point. As a billboard, it will always face to the user and have the same size. User can also set the extra height for the billboard.Result: Rendering point 3D as a billboard support is added to QGIS 3.10
3D Bookmark View
Unfortunately, I couldn't manage to work on this feature in the GSoC period. The billboard rendering feature took more time than I expected.
There some ideas that can be added to the current project:
- 3D Map View bookmarks is not implemented in this project duration due to time constraint since the billboard rendering implementation needs more time than the initial expectation.
- Extra feature for 3D On-Screen Navigation: Make it as a floating widget, but it will need to add another dependency if implemented with QtQuick or extra work if implemented with manual rendering in the 3D map scene
- Extra feature for 3D Measurement Tool: Show the Z-value difference between two consecutive points
Extra feature for 3D Billboard Rendering for Point:
- Add data-driven symbol support: It needs multi-texture rendering, currently it only supports one texture.
- Add a vertical line from the feature to the billboard
Thanks for my mentor Martin and Peter who helped me a lot in this project (e.g. giving good guidance, answering my question, sharing knowledge, and so on). I think I have the best mentor for this project. I also want to say thank to Tim Sutton, Nyall Dawson, and Akbar Gumbira for my early proposal discussion. And of course, the whole QGIS community has been very supportive with the comments, the suggestions, the ideas, and the hackfests. It's really a great community. I hope I can contibute more in the future.
The last but not the least, for my wife (Dian Rokhmawati) who is always supporting me behind the scene :)
- [3D] On screen navigation
- [3D] Measurement tool
- Bug fix: Always enable 3d model material for non 3D model shape.
- Bug fix: Set ambient to not transparent for measurement line.
- [3D] Billboard Rendering for Point 3D
Contact me at email@example.com if you have any queries regarding GSoC, QGIS 3D (and QGIS itself), or want to share some food.