melowntech / vts-browser-js

JavaScript WebGL 3D map rendering engine
BSD 2-Clause "Simplified" License
220 stars 42 forks source link

Modifying Freelayer position #217

Open AriemX opened 2 years ago

AriemX commented 2 years ago

Hi,

I've comme across an problem I can't solve by searching in the different documentations.

I have a view containing three elements :

Everything loads perfectly in the browser exept that the 3D model is below the DEM and I wanted to align them properly in altitude.

I know there is the zShift parameter to modify the height of the model when running slpk2vts, however I don't know the exact required value and "trials and errors" method may take too much time for each tests (one run of slpk2vts takes aproximatly 2hours). Is there a way to apply a transform to a freelayer in a view to change the height at runtime ?

jrjdavidson commented 2 years ago

Hi ariem, Don't have an answer to this but I have encountered the same problem. I have found the best way to work it is to process once, then load the model in the planned vts environment, and then use the included measuring tool to get the vertical offset ( one of the tools. That usually gets you close enough. Also one word of warning - it might always look a little strange given that you are using a regional DEM alongside a detailed 3D model. The precision of the regional dataset (probably SRTM data for the surface?) means that the seam will always look a little wonky. Two things I usually do to make it look a little better is to try and find a smaller dataset to

  1. add as a detailed surface around the model, such as a lidar dataset ( we have quite a few public lidar data here in NZ) and
  2. make sure the the detailed model is just a little proud of the regional data

Hope this helps! I still think there isn't anything quite like VTS around so I think it's worth the effort to explore this package.

AriemX commented 2 years ago

Hi,

Thank you for your response !

I've been thinking to use a similar way to tackle the problem. However, I've been a bit lost on the tool to use. Which one have you used for that ? Maybe I've missed something in the tutorial and/or the documentation.

I assumed large DEM + High resolution models will be a bit strange (and maybe with some holes on the seam, as you said). We are aiming to get smaller areas with higher resolution latter.

jrjdavidson commented 2 years ago

There is an option when you first load the maps to get a measuring tool

I think it's controlMeasure : true

AriemX commented 2 years ago

I found it, thank you very much !