-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
featurefeaturefeature
Description
function addGltf() {
clock = new THREE.Clock();
stats = new Stats();
map.getContainer().appendChild(stats.dom);
var loader = new THREE.GLTFLoader();
loader.load('./data/alien.gltf', function (gltf) {
model = gltf.scene;
model.rotation.x = Math.PI / 2;
model.scale.set(100, 100, 100);
baseObjectModel = threeLayer.toModel(model, { coordinate: map.getCenter() });
// model.position.copy(threeLayer.coordinateToVector3(map.getCenter()));
threeLayer.addMesh(baseObjectModel);
baseObjectModel.on('mousemove', e => {
//这里能否在e 得到 点击位置的高程值???
const target = e.target;
const intersect = target.intersect;
//do some things
if (intersect && intersect.object && intersect.object.material) {
intersect.object.material.color.set('red');
}
})
// createGUI(model, gltf.animations);
animate();
}, undefined, function (e) {
console.error(e);
});
}
Metadata
Metadata
Assignees
Labels
featurefeaturefeature