minorua / Qgis2threejs

3D map visualization and web export plugin for QGIS
http://minorua.github.io/Qgis2threejs/docs/
495 stars 91 forks source link

Measurement units changed on export #260

Closed vovchykbratyk closed 2 years ago

vovchykbratyk commented 2 years ago

I have a scene in QGIS (terrain and image) that measures around 493 meters by 677 meters. Everything is projected in UTM (meters).

Everything looks great in Qgis2threejs.

When I export the scene as either glb or gltf, and open it in Blender (also default meters, set to scale factor of 1.0), the measurements totally change.

Blender reports the measurement as approximately 36 meters by 50 meters.

Playing with the base width "sort of" helps, but I do not know how to make it scale properly and can't find anything on the internet about it.

How do I ensure that my measurements stay consistent between projected coordinate system and 3D space?

minorua commented 2 years ago

When you set base width to the same value as base extent width, the units of exported model are same as units of project CRS.

image

vovchykbratyk commented 2 years ago

Thanks for the fast response!

I think I'd like to convert this to a feature request, then. I'd like to be able to get the canvas properties (base width, length/x, height/y) automatically from the active QGIS window so that it is just a simple option to produce a model at 1:1 scale units.

Currently I have to go into the QGIS python console, and use a qgis.utils.iface.mapCanvas().size() call to get those numbers. Is there a way this could be added in to the Qgis2threejs Scene Settings?

I am thinking Qgis2threejs must already be querying the mapCanvas().size() property in order to update the view extent in the 3D window, so hopefully this wouldn't be a difficult addition?

minorua commented 2 years ago

I've been thinking about the coordinate system in 3D space since I read the Potree source code. Calculation costs on coordinate transformation can be reduced by avoiding scaling. I think 1:1 should be default.

minorua commented 2 years ago

Origin of xy-plane setting is added to scene settings dialog in version 2.7. Thanks!