emacroh5lib 1.0.83 → 1.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -128,6 +128,10 @@
|
|
128
128
|
showThumbnail: {
|
129
129
|
type: Boolean,
|
130
130
|
default: false,
|
131
|
+
},
|
132
|
+
background: {
|
133
|
+
type: Number,
|
134
|
+
default: 0xb9d3ff,
|
131
135
|
}
|
132
136
|
},
|
133
137
|
computed: {
|
@@ -159,7 +163,7 @@
|
|
159
163
|
mounted() {
|
160
164
|
|
161
165
|
// this.show = true
|
162
|
-
|
166
|
+
|
163
167
|
|
164
168
|
|
165
169
|
// Message.success("按键提示 ");
|
@@ -363,8 +367,10 @@
|
|
363
367
|
|
364
368
|
// 计算空间两点中点
|
365
369
|
getCenterPosition(A, B) {
|
366
|
-
|
367
|
-
|
370
|
+
if (A.z == null || B.z == null) {
|
371
|
+
return { x: (A.x + B.x) / 2, y: (A.y + B.y) / 2 }
|
372
|
+
}
|
373
|
+
return { x: (A.x + B.x) / 2, y: (A.y + B.y) / 2, z: (A.z + B.z) / 2 }
|
368
374
|
},
|
369
375
|
|
370
376
|
|
@@ -407,6 +413,12 @@
|
|
407
413
|
this.loading = false
|
408
414
|
|
409
415
|
|
416
|
+
const keyEvent = new KeyboardEvent('keydown', {
|
417
|
+
bubbles: true, cancelable: true, keyCode: 90
|
418
|
+
});
|
419
|
+
document.dispatchEvent(keyEvent);
|
420
|
+
|
421
|
+
|
410
422
|
|
411
423
|
|
412
424
|
|
@@ -763,7 +775,7 @@
|
|
763
775
|
*/
|
764
776
|
this.gl.renderer = new THREE.WebGLRenderer();
|
765
777
|
this.gl.renderer.setSize(width, height); //设置渲染区域尺寸
|
766
|
-
this.gl.renderer.setClearColor(
|
778
|
+
this.gl.renderer.setClearColor(this.background, 1); //设置背景颜色
|
767
779
|
|
768
780
|
this.gl.WebGLoutput.innerHTML = ""
|
769
781
|
this.gl.renderer.domElement.style.width = "100%"
|
@@ -850,6 +862,20 @@
|
|
850
862
|
})
|
851
863
|
|
852
864
|
|
865
|
+
document.addEventListener("keydown", event => {
|
866
|
+
|
867
|
+
if (event.key == '') {
|
868
|
+
const gl = this.gl
|
869
|
+
const zd = gl.camera.position.z !== 0 ? -gl.camera.position.z : -d
|
870
|
+
gl.camera.position.set(0, 0, zd);
|
871
|
+
gl.camera.lookAt(new THREE.Vector3(0, 0, 0));
|
872
|
+
gl.ambient.position.set(0, 0, zd);
|
873
|
+
gl.pointLight.position.set(0, 0, zd);
|
874
|
+
gl.axialDirection = zd > 0 ? 'z' : '-z';
|
875
|
+
}
|
876
|
+
|
877
|
+
})
|
878
|
+
|
853
879
|
|
854
880
|
document.addEventListener("keyup", event => {
|
855
881
|
|
@@ -27,7 +27,7 @@
|
|
27
27
|
</Draw>
|
28
28
|
|
29
29
|
<!-- <video-viewer :list="srcList" :show.sync="showVideoViewer" width="80%" height="80%" /> -->
|
30
|
-
<model-viewer :list="modelList" :show.sync="showModelViewer" width="80%" height="80%" />
|
30
|
+
<model-viewer :list="modelList" :show.sync="showModelViewer" width="80%" height="80%" :background="0xff0000" />
|
31
31
|
|
32
32
|
</div>
|
33
33
|
</template>
|