Babylon.js 构建 地球,支持切片地图 (二)
2022-09-29 本文已影响0人
haibalai
首先babylonjs 相机我们要改造
对于相机改造类图如下

针对EarthCamera类
const BABYLON = require('babylonjs');
export class EarthCamera extends BABYLON.ArcRotateCamera {
constructor(e, t, i, n, r, o, s) {
super(e, t, i, n, r, o),
this.isDirty = true,
this.diffAlpha = 0,
this.diffBeta = 0,
this.diffRadius = 0,
this.latLonAtmouse = new BABYLON.Vector2
}
}
针对CameraControl
```javascript
更多参考 https://xiaozhuanlan.com/topic/2173489065