1. cesium 方法 viewer.scene.pickPosition(windowPosition, result) → Cartesian3 Scene/Scene.js 3486 Returns the cartesian position reconstructed from the depth buffer and window position. The position reconstructed from the depth buffer in 2D may be slightly different from those reconstructed in 3D and Columbus view. This is caused by the difference in the distribution of depth values of perspective and orthographic projection. Set Scene#pickTranslucentDepth to true to include the depth of translucent primitives; otherwise, this essentially picks through translucent primitives. Name Type Description windowPosition Cartesian2 Window coordinates to perform picking on. result Cartesian3 optional The object on which to restore the result. Returns: The cartesian position. Throws: DeveloperError : Picking from the depth buffer is not supported. Check pickPositionSupported. 2. mars3d 方法 let wheelingPosition = {}; // 给$(".cesium-viewer")元素添加 mousemove 事件。 $(".cesium-viewer").on("mousemove", function (event) { /*功能:获取鼠标的实时位置。*/ wheelingPosition.x = event.clientX; wheelingPosition.y = event.clientY; // console.log("wheelingPosition:", wheelingPosition); // wheelingPosition: {x: 139, y: 312} }); // 获取鼠标位置(笛卡尔坐标系,即,地球直角坐标系)。 let Cartesian3_CurrentMousePosition = mars3d.point.getCurrentMousePosition(viewer.scene, wheelingPosition); // console.log("Cartesian3_CurrentMousePosition:", Cartesian3_CurrentMousePosition); // Cartesian3_CurrentMousePosition: a {x: -2308816.906348081, y: 4393127.8631515205, z: 3992865.6356029827}
cesium mars3d screenPointToMap.txt
最新推荐文章于 2024-05-08 13:51:50 发布