第2世界
发布于 2024-07-05 / 19 阅读 / 0 评论 / 0 点赞

threejs设置背景图

//设置场景颜色
onSetSceneColor(color) {
	this.scene.background = new THREE.Color(color)
}
//设置场景图片
onSetSceneImage(url) {
	this.scene.background = new THREE.TextureLoader().load(url);
}
// 设置全景图
onSetSceneViewImage(url) {
	const texture = new THREE.TextureLoader().load(url);
	texture.mapping = THREE.EquirectangularReflectionMapping
	this.scene.background = texture
	this.scene.environment = texture
}


评论