cre*_*ers 0 geolocation augmented-reality three.js react-three-fiber
我想使用基于位置的标记来增强固定网络摄像头的图像。这将被添加到现有的 React 应用程序中,该应用程序在其他部分已经使用了 Three.js (通过React-Three-Fiber),因此这些技术将被重用。
\n\n虽然计算标记(已知位置)相对于相机(已知位置)的位置很容易,但我正在努力调整相机的配置,以便在“真实”对象和“真实”对象之间获得良好的视觉匹配。 AR 标记。
\n\n我创建了一个codesandbox,其中包含一个说明挑战的人工示例。
\n\n这是我配置相机的尝试:
\n\nconst camera = {\n position: [0, 1.5, 0],\n fov: 85,\n near: 0.005,\n far: 1000\n};\n\nconst bearing = 109; // degrees\n\n<Canvas camera={camera}>\n <Scene bearing={bearing}/>\n</Canvas>\nRun Code Online (Sandbox Code Playgroud)\n\n在场景组件中,I\xe2\x80\x99m 根据网络摄像头的方位旋转摄像头,如下所示:
\n\n...\n\nconst rotation = { x: 0, y: bearing * -1, z: 0 };\ncamera.rotation.x = (rotation.x * Math.PI) / 180;\ncamera.rotation.y = (rotation.y * Math.PI) / 180;\ncamera.rotation.z = (rotation.z * Math.PI) / 180;\n\n...\nRun Code Online (Sandbox Code Playgroud)\n\n关于如何配置相机以实现 Three.js 框和现实生活中的物体的良好匹配,有什么技巧/想法吗?
\n小智 6
作为一名GIS开发人员,我可以对这个问题给出一些提示:
var xy = proj4( "EPSG:4326", "EPSG:3857", [ lon, lat ] );var position = new THREE.Vector3( camXY[ 0 ] - markerXY[ 0 ], 0.0, markerXY[ 1 ] - camXY[ 1 ] );| 归档时间: |
|
| 查看次数: |
2078 次 |
| 最近记录: |