Skip to content

Add QEP 341: add 3D pedestrian view#341

Open
benoitdm-oslandia wants to merge 7 commits intoqgis:masterfrom
benoitdm-oslandia:feat/341-3d-pedestrian-view
Open

Add QEP 341: add 3D pedestrian view#341
benoitdm-oslandia wants to merge 7 commits intoqgis:masterfrom
benoitdm-oslandia:feat/341-3d-pedestrian-view

Conversation

@benoitdm-oslandia
Copy link
Contributor

Here is an screencast (without the cursor capture) of a POC:

Kooha-2025-06-18-14-46-55.webm

cc @ptitjano

@nyalldawson nyalldawson added In Discussion QEPs currently in discussion stage Project A proposal which concerns a project, eg new functionality labels Jun 18, 2025
@nyalldawson
Copy link
Contributor

@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

@benoitdm-oslandia
Copy link
Contributor Author

@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!

@wonder-sk
Copy link
Member

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)

@benoitdm-oslandia
Copy link
Contributor Author

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.)

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.

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)

Yes.

@benoitdm-oslandia
Copy link
Contributor Author

@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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@nyalldawson nyalldawson Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: how will you handle walking into the edges of the terrain/nodata areas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 QgsTerrainGenerator and 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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a small fix as the elevation fixes are external to this PR.

Does it look good to you @nyalldawson?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the elevation fixes are available in this PR

Copy link
Contributor Author

@benoitdm-oslandia benoitdm-oslandia Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is ready for review here!

@nyalldawson
Copy link
Contributor

@benoitdm-oslandia

can we call for the vote?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In Discussion QEPs currently in discussion stage Project A proposal which concerns a project, eg new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants