Add QEP 341: add 3D pedestrian view#341
Add QEP 341: add 3D pedestrian view#341benoitdm-oslandia wants to merge 7 commits intoqgis:masterfrom
Conversation
|
@benoitdm-oslandia please announce this to the DEV and USER lists, as per https://github.com/qgis/QGIS-Enhancement-Proposals?tab=readme-ov-file#process-and-policies |
I forgot this point! Fixed! |
|
Technically speaking, what are the differences between the existing walk/fly mode and the proposed pedestrian mode? (i.e. what would change in QgsCameraController?) From what I understand, the main difference is that the new pedestrian mode would try to keep fixed camera elevation above the terrain, while the existing walk/fly mode allows arbitrary elevation? If that's the case, the existing walk/fly mode should just get an optional constraint "keep elevation X meters above terrain", rather than adding a completely new navigation mode. (here I'm talking only about the camera controller code, not GUI.) How do you plan to keep the camera at constant elevation above the terrain? Are you going to use QgsTerrainGenerator::heightAt() on every move? (note that for raster DEM terrain the implementation is quite naive and using just a very coarse grid) |
Indeed there is not big difference between the 2 modes but the pedestrian mode needs the user to select the view point to start from.
Yes. |
|
@nyalldawson can we call for the vote? |
|
|
||
| A drop-down menu (with the 3 navigation modes) in the "camera" tool in the toolbar to easy the switching from one mode to another. | ||
|
|
||
| Once this mode is activated, the user will select where to begin navigation: a marker will be placed vertically above the center of the 3D view. The user moves the marker to the desired location and confirms with a left mouse click or the Enter key. |
There was a problem hiding this comment.
Can you clarify how the marker is moved? Is this via drag and drop? (And from a technical perspective, how will you handle the marker and interaction with it?)
There was a problem hiding this comment.
Can you clarify how the marker is moved? Is this via drag and drop?
The marker follows the mouse moves and is placed on the ground where the mouse cursor is located. There is no need to keep the left mouse button to move the marker and the left mouse click validates the starting point.
how will you handle the marker and interaction with it?
The marker is a vertical rubberband going upward from the ground with a fixed length (2 points, but it could be a triangle). Each time the user move the mouse, the marker position is updated.
| The current **Walk** mode will be renamed **Fly** as the pedestrian view is more a real walk mode. | ||
|
|
||
| As we will have 3 navigation modes, the 3D UI should display the current mode in use and a way to switch from one to another. | ||
|
|
There was a problem hiding this comment.
There's still technical details missing here. I would like to see in depth details on how you propose to handle the fixed height-above-ground requirement. @wonder-sk pointed out earlier that QgsTerrainGenerator::heightAt() may be inappropriate due to the coarseness of this API -- have you tested to see whether it works and can give a smooth navigation result?
There was a problem hiding this comment.
Also: how will you handle walking into the edges of the terrain/nodata areas?
There was a problem hiding this comment.
There's still technical details missing here. I would like to see in depth details on how you propose to handle the fixed height-above-ground requirement. @wonder-sk pointed out earlier that
QgsTerrainGenerator::heightAt()may be inappropriate due to the coarseness of this API -- have you tested to see whether it works and can give a smooth navigation result?
Indeed. @benoitdm-oslandia has been been working on a prototype to improve QgsTerrainGenerator::heightAt() . It mostly involves two changes:
- listen to the DTM texture generation in
QgsTerrainGeneratorand store them in a cache. The cache has some logic to only keep the highest level when available. This replaces, - in
Qgs3DMapScene, when a better level is stored, reload the relevant vector tiles if necessary
There was a problem hiding this comment.
Also: how will you handle walking into the edges of the terrain/nodata areas?
Not much can be done in that case, except a fallback to 0 + terrainOffset
There was a problem hiding this comment.
Not much can be done in that case, except a fallback to
0 + terrainOffset
Well, you could keep the pedestrian's last elevation so he doesn't fall in potholes/fall off the edge of flat earth 🤣 but rather "float" over them.
Another option would be to interpolate missing values.
There was a problem hiding this comment.
Can you add these missing technical details please? Include the proposed changes @benoitdm-oslandia has been testing for heightAt so that voters can make an informed decision.
There was a problem hiding this comment.
I made a small fix as the elevation fixes are external to this PR.
Does it look good to you @nyalldawson?
There was a problem hiding this comment.
It's ok for me -- but you may want to get those fixes reviewed and merged first, as this proposal depends on them.
Your choice though, we can put this to voting when you're ready.
There was a problem hiding this comment.
the elevation fixes are available in this PR
We can, at any stage you're ready. But in its current form it'd be a -1 from me. I've just added a follow up review with my remaining concerns. |
Here is an screencast (without the cursor capture) of a POC:
Kooha-2025-06-18-14-46-55.webm
cc @ptitjano