唐润平:视角切换修改版-重新提交
This commit is contained in:
@@ -164,7 +164,6 @@ export default class Demo {
|
||||
// 匹配附着点(这里不适合对单个模型进行保存,批量对模型进行操作)
|
||||
if (child.isMesh && /^point+/.test(child.name)) {
|
||||
this.points.push(child);
|
||||
console.log(child.name);
|
||||
// 改变为基础材质
|
||||
child.material = new this.THREE.MeshBasicMaterial();
|
||||
child.scale.set(0.01, 0.01, 0.01);
|
||||
@@ -420,10 +419,10 @@ export default class Demo {
|
||||
);
|
||||
this.opacityTween.start();
|
||||
this.opacityTween.onUpdate((obj) => {
|
||||
mesh.material.opacity = obj.opacity;
|
||||
mesh2.material.opacity = obj.opacity;
|
||||
mesh3.material.opacity = obj.opacity;
|
||||
mesh4.material.opacity = obj.opacity;
|
||||
// mesh.material.opacity = obj.opacity;
|
||||
// mesh2.material.opacity = obj.opacity;
|
||||
// mesh3.material.opacity = obj.opacity;
|
||||
// mesh4.material.opacity = obj.opacity;
|
||||
if (!isNeedLookAt) return;
|
||||
this.camera.lookAt(obj.lookX, obj.lookY, obj.lookZ);
|
||||
this.orbitControls.target.set(obj.lookX, obj.lookY, obj.lookZ);
|
||||
|
||||
@@ -22,29 +22,28 @@ export function handleRClick(targetPoint) {
|
||||
this.tag3CSS2DObj.translateX(3);
|
||||
this.tag3CSS2DObj.translateZ(10);
|
||||
this.tag3CSS2DObj.translateY(-5);
|
||||
intoAnimation.call(this, 4.31, -2.55, -10);
|
||||
intoAnimation.call(this, 4.31, -2.55, -11);
|
||||
} else if (/tl$/.test(targetPoint.name)) {
|
||||
this.tag3CSS2DObj.translateX(-3);
|
||||
this.tag3CSS2DObj.translateZ(10);
|
||||
this.tag3CSS2DObj.translateY(-5);
|
||||
intoAnimation.call(this, -4.31, -2.55, -10);
|
||||
intoAnimation.call(this, -4.31, -2.55, -11);
|
||||
} else if (/tc$/.test(targetPoint.name)) {
|
||||
this.tag3CSS2DObj.translateX(0);
|
||||
this.tag3CSS2DObj.translateZ(10);
|
||||
this.tag3CSS2DObj.translateY(-8);
|
||||
intoAnimation.call(this, 0, -2.55, -10);
|
||||
this.tag3CSS2DObj.translateY(-6);
|
||||
intoAnimation.call(this, 0, -2.55, -11);
|
||||
} else if (/br$/.test(targetPoint.name)) {
|
||||
this.tag3CSS2DObj.translateX(4);
|
||||
this.tag3CSS2DObj.translateZ(6);
|
||||
this.tag3CSS2DObj.translateY(5);
|
||||
this.tag3CSS2DObj.translateX(2);
|
||||
this.tag3CSS2DObj.translateZ(10);
|
||||
this.tag3CSS2DObj.translateY(3);
|
||||
intoAnimation.call(this, 4.31, 5, -11);
|
||||
} else if (/bl$/.test(targetPoint.name)) {
|
||||
this.tag3CSS2DObj.translateX(-4);
|
||||
this.tag3CSS2DObj.translateZ(6);
|
||||
this.tag3CSS2DObj.translateY(5);
|
||||
this.tag3CSS2DObj.translateX(-2);
|
||||
this.tag3CSS2DObj.translateZ(10);
|
||||
this.tag3CSS2DObj.translateY(3);
|
||||
intoAnimation.call(this, -4.31, 5, -11);
|
||||
}
|
||||
this.scene.add(this.tag3CSS2DObj);
|
||||
|
||||
// 返回给编辑组件的回调函数
|
||||
this.editDev(targetPoint);
|
||||
@@ -86,4 +85,7 @@ function intoAnimation(x = -10, y = 3, z = -12) {
|
||||
// this.orbitControls.target.set(obj.x, obj.y, -obj.z);
|
||||
this.orbitControls.target.set(obj.xTarget, obj.yTarget, obj.zTarget);
|
||||
});
|
||||
this.intoPointAnimation.onComplete(() => {
|
||||
this.scene.add(this.tag3CSS2DObj);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user