Qgis2threejs icon indicating copy to clipboard operation
Qgis2threejs copied to clipboard

Add a new "layer" entry?

Open perrette opened this issue 8 years ago • 4 comments

Amazing package, it worked almost instantly, is fast, has already quite a few options etc... Just one thing puzzled me, but it might be due to the fact that I am also quite new to QGIS, and to the particular use I am making of QGIS2threejs.

Why is it necessary to specify a separate DEM for each display layer? Wouldn't it be more general to have the DEMs on the one hand, and the features / coloring / images on the other? It is already the case for point, line, polygon.

Say, I want to create a 3D vizualization with a number of datasets on a given DEM. To take a real-world example, I am indeed interested in visualizing surface velocity, and say, some satellite image of surface cover, which both map to surface elevation DEM. Using the layer visibility attribute, I can indeed switch on and off one or the other, so that I can easily switch between them and compare interesting aspect (and in my practical case, find an interesting 3-D point of view, and make snap shop of one layer, then of the other, and further work on the images in GIMP). Right now I need to duplicate a DEM and rename it, in order to add it. It is quite easy, but conceptually sub-optimal (and it pollutes QGIS layers' namespace).

So I would imagine the following:

  • DEMs
    • Main DEM
    • Additional DEMs
  • Objects
    • Map Canvas image
    • Layer Image
    • Image file
    • Solid Color
    • Point
    • Line
    • Polygon

Where each object can specify which DEM it is defined on (main DEM by default). While the DEM entries offer a choice between a finite number of DEMs (already loaded in QGIS), the Objects entries would appear under the form (Add / Remove), since one may have several image files, or even display a line on two different DEMs (why not...).

Well, just an idea. What do you think? (there will be a need to find a solution to solve priority order in the display when several feature are on the same DEM, but that is anyway required)

Thanks again for the good work.

perrette avatar Jan 21 '16 21:01 perrette

Right now, when creating copies of DEMs to have several displays on the same DEM, the 3-D rendering is buggy (can't decide which layer to show on top: noisy look). In the interface suggested above, the natural order would be provided by the order of addition. Internally, when passed to three.js, the layers could then be (vertically) offset by a fraction of the total vertical extent...

The example below shows both landmask and surface velocity for a Greenland area (transparent when no motion), both indexed on surface elevation (originial and copy...), hence the noisy aspect.

screenshot from 2016-01-21 22 32 32

perrette avatar Jan 21 '16 21:01 perrette

Thank you for the suggestion.

Previous versions focused on making it easy to export a DEM layer quickly. In next version, the plugin will have an interactive preview, so we will be able to switch DEM texture in the QGIS GUI and immediately see the result in 3D view.

New GUI will probably have an object tree (or list) like QGIS legend tree. Since "Add layer" function is a bit complicated at first glance, I didn't adopt it in previous versions. The interactive preview can reduce the difficulty to know what happens by the action, I think.

It would be good to have ability to switch DEM texture also in dat-gui panel.

minorua avatar Jan 23 '16 02:01 minorua

@perrette I'm a bit late to the party here but I wanted to note that your problem is solvable in the current release of the package.

The problem with showing multiple DEMs is not that ThreeJS can't figure out how to display your order, but that your DEMs are exported at different grid densities. This means that the vectors of your mesh are not lining up, which is why you get that mosaic pattern in your model. Make sure that your resampling option is set identically on each additional DEM.

This should fix your major problem. There are still issues with the additional DEMs layering in an unintuitive order. As of now the base DEM is lowest in display priority, but first on your datGUI list, with each additional DEM showing in an inverse priority to the list order.

Also, as you noted, this is a very inefficient way to handle things from a processing power perspective. It's doubling your vertex count with each additional DEM, unless you clip the additional DEMs to a smaller area.

resample

DigDigDig avatar Feb 23 '17 17:02 DigDigDig

I have not used it in a while but will let you know when I have the chance to take a look. Thanks.

perrette avatar Feb 24 '17 11:02 perrette