Closed kannes closed 2 years ago
Following https://qgis2threejs.readthedocs.io/en/docs/ExportProgrammaticallyUsingPython.html I set up a scene and saved it as image.
Then I changed the CAMERA dictionary to
CAMERA = {"position": {"x": 123, "y": 234, "z": 345}, "target": {"x": 0, "y": 0, "z": 0}}
and ran the script again. The resulting image is the same. The camera is not positioned somewhere else.
I also edit the target:
CAMERA = {"position": {"x": 0, "y": 0, "z": 0}, "target": {"x": 123, "y": 234, "z": 345}}
and ran the script again. The resulting image is the same. The camera is not pointing somewhere else.
Trying to find the issue I added two prints to https://github.com/minorua/Qgis2threejs/blob/d3edab611e667390164c99248208fb58623fd030/q3dview.py#L227, callling self.cameraState(). One at the beginning of the function, one at the end. They both print the same camera parameters:
self.cameraState()
{'lookAt': {'x': 0.0, 'y': 0.0, 'z': 0.0}, 'pos': {'x': 0.0, 'y': -99.99999999999994, 'z': 99.99999999999997}} {'lookAt': {'x': 0.0, 'y': 0.0, 'z': 0.0}, 'pos': {'x': 0.0, 'y': -99.99999999999994, 'z': 99.99999999999997}}
So I assume the setCameraState function either in Python or JS is broken.
setCameraState
Sweet, thank you!
Thanks!
Following https://qgis2threejs.readthedocs.io/en/docs/ExportProgrammaticallyUsingPython.html I set up a scene and saved it as image.
Then I changed the CAMERA dictionary to
and ran the script again. The resulting image is the same. The camera is not positioned somewhere else.
I also edit the target:
and ran the script again. The resulting image is the same. The camera is not pointing somewhere else.
Trying to find the issue I added two prints to https://github.com/minorua/Qgis2threejs/blob/d3edab611e667390164c99248208fb58623fd030/q3dview.py#L227, callling
self.cameraState()
. One at the beginning of the function, one at the end. They both print the same camera parameters:So I assume the
setCameraState
function either in Python or JS is broken.