赞
踩
- const getCameraInfo = () => {
- let viewer = Viewer.value;
- const camera = viewer.scene.camera;
- const cartographic = Cesium.Cartographic.fromCartesian(camera.position);
- const x = Cesium.Math.toDegrees(cartographic.longitude);
- const y = Cesium.Math.toDegrees(cartographic.latitude);
- const z = cartographic.height;
-
- let heading = Cesium.Math.toDegrees(camera.heading);
- let pitch = Cesium.Math.toDegrees(camera.pitch);
- let roll = Cesium.Math.toDegrees(camera.roll);
-
- let pt = Cesium.Cartographic.fromDegrees(x, y, z);
- let ellipsoid = viewer.scene.globe.ellipsoid;
- let cartesian3 = ellipsoid.cartographicToCartesian(pt);
- let objInfo = {
- longitude: x,
- latitude: y,
- height: z,
- x: cartesian3.x,
- y: cartesian3.y,
- z: cartesian3.z,
- heading: heading,
- pitch: pitch,
- roll: roll
- };
- console.log(objInfo);
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。