minorua / Qgis2threejs

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

Making Export to web Orbit by default AND preserving Current viewpoint #263

Open LovroLKP opened 2 years ago

LovroLKP commented 2 years ago

Dear contributors, this is more of a question then an issue. I am trying to make the html export Orbit by default. I tried the simplest option of just adding the "app.cameraAction.orbit" call in the script of index.html file. It works alright BUT it "forgets" the chosen export Viewpoint (It starts orbiting around the base, the bottom of the cube, not the surface of the terrain).

Untitled-2

Is there a SIMPLE way of calling back the viewpoint (lookAt:) just in the html file, without going too deep into the .js files?

The files were exported with v2.5, I tested it with updated plugin, v2.6 - same issue...

Any help would be much appreciated! Lovro

minorua commented 2 years ago

app.cameraAction.orbit() changes target point (See https://github.com/minorua/Qgis2threejs/blob/v2.6/js/Qgis2threejs.js#L1233). Use app.setRotateAnimationMode(true); instead of app.cameraAction.orbit();.

LovroLKP commented 2 years ago

THANK YOU! I knew there has to be a call in existing code to do that...:)