更新平行光照射范围
This commit is contained in:
parent
dcce738ede
commit
ffc96a2824
@ -88,6 +88,7 @@ const deviceMapping = {
|
||||
id: 1,
|
||||
name: "2.5M立车(3)",
|
||||
number: "015-126",
|
||||
// number: "076-004",
|
||||
},
|
||||
2: {
|
||||
id: 2,
|
||||
@ -644,10 +645,10 @@ function init() {
|
||||
directionalLight.shadow.radius = 1;
|
||||
// // 设置三维场景计算阴影的范围
|
||||
|
||||
directionalLight.shadow.camera.left = -350;
|
||||
directionalLight.shadow.camera.right = 350;
|
||||
directionalLight.shadow.camera.top = 350;
|
||||
directionalLight.shadow.camera.bottom = -350;
|
||||
directionalLight.shadow.camera.left = -450;
|
||||
directionalLight.shadow.camera.right = 450;
|
||||
directionalLight.shadow.camera.top = 450;
|
||||
directionalLight.shadow.camera.bottom = -450;
|
||||
directionalLight.shadow.camera.near = 0.5;
|
||||
directionalLight.shadow.camera.far = 1200;
|
||||
// directionalLight.target = mesh;
|
||||
@ -726,7 +727,7 @@ function init() {
|
||||
gltf.scene.scale.multiplyScalar(1);
|
||||
model.add(gltf.scene);
|
||||
// model.position.x = -20;
|
||||
model.position.y = 35;//上移
|
||||
model.position.y = 30;//上移
|
||||
model.position.z = -10;
|
||||
model.receiveShadow = true;
|
||||
|
||||
@ -777,11 +778,11 @@ const updateSprites = (modelScene) => {
|
||||
map: spriteTexture,
|
||||
}); // 创建精灵图警告
|
||||
const sprite = new THREE.Sprite(spriteMaterial);
|
||||
sprite.scale.set(4.5,4.5,4.5); // 设置精灵图警告的位置在模型上方
|
||||
sprite.scale.set(7,7,7); // 设置精灵图警告的位置在模型上方
|
||||
|
||||
const spritePosition = spriteModel.position.clone();
|
||||
spritePosition.y += 2; // 在模型位置的基础上向上偏移 4 个单位
|
||||
// spritePosition.x -= 1; // 在模型位置的基础上向上偏移 4 个单位
|
||||
spritePosition.y += 4; // 在模型位置的基础上向上偏移 4 个单位
|
||||
spritePosition.x -= 2; // 在模型位置的基础上向上偏移 4 个单位
|
||||
sprite.position.copy(spritePosition); // 将精灵图警告添加到模型对象的父级容器中
|
||||
|
||||
spriteModel.parent.add(sprite);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user