function loadImg(_url, _this) {
var img = new Image();
img.src = _url;
img.onload = function () {
cxt.drawImage(img, 0, 0)
//把canvas作为纹理
var texture = new THREE.Texture(canvas);
texture.needsUpdate = true;
var spritematerial = new THREE.SpriteMaterial({ map: texture });
var sprite = new THREE.Sprite(spritematerial);
//进行缩放
sprite.scale.set(20, 10, 20);
sprite.position.set(coorArr[0], coorArr[1], coorArr[2])
_this.props.scene.add(sprite);
};
}
loadImg(wsp, this);
图片加载完成之后 在场景中添加图片
6049

被折叠的 条评论
为什么被折叠?



