mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
平面。
This commit is contained in:
parent
57641bdb57
commit
e42ebb54a3
@ -28,10 +28,13 @@ TiledLayerRenderer.prototype.render = function (layer) {
|
||||
var alt = this.globe.alt;
|
||||
|
||||
this.mesh.material.length = 0;
|
||||
this.mesh.geometry.groups.length = 0;
|
||||
|
||||
this.creator.get(lon, lat, alt).forEach(n => {
|
||||
this.creator.get(lon, lat, alt).forEach((n, i) => {
|
||||
if (n.material) {
|
||||
n.material.group.materialIndex = i;
|
||||
this.mesh.material.push(n.material);
|
||||
this.mesh.geometry.groups.push(n.material.group);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -4,16 +4,10 @@ import WGS84 from '../../core/WGS84';
|
||||
* 瓦片几何体
|
||||
*/
|
||||
function TiledGeometry() {
|
||||
THREE.SphereBufferGeometry.call(this, WGS84.a, 16, 16);
|
||||
|
||||
this.groups = [{
|
||||
start: 0,
|
||||
count: 1440,
|
||||
materialIndex: 0
|
||||
}];
|
||||
THREE.PlaneBufferGeometry.call(this, WGS84.a, WGS84.a);
|
||||
}
|
||||
|
||||
TiledGeometry.prototype = Object.create(THREE.SphereBufferGeometry.prototype);
|
||||
TiledGeometry.prototype = Object.create(THREE.PlaneBufferGeometry.prototype);
|
||||
TiledGeometry.prototype.constructor = TiledGeometry;
|
||||
|
||||
export default TiledGeometry;
|
||||
@ -33,6 +33,8 @@ function TiledMaterial(x, y, z) {
|
||||
value: new THREE.TextureLoader().load((new BingTileSystem()).tileXYToUrl(x, y, z))
|
||||
}
|
||||
};
|
||||
|
||||
this.group = { start: 0, count: 6, materialIndex: 0 };
|
||||
}
|
||||
|
||||
TiledMaterial.prototype = Object.create(THREE.ShaderMaterial.prototype);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user