main
parent
cd8fe06628
commit
0271ed9129
272948
public/jzc/scene.gltf
272948
public/jzc/scene.gltf
File diff suppressed because one or more lines are too long
|
@ -39,6 +39,12 @@ onMounted(() => {
|
||||||
renderScene();
|
renderScene();
|
||||||
//点击模型
|
//点击模型
|
||||||
document.addEventListener('click', onMouseDown);
|
document.addEventListener('click', onMouseDown);
|
||||||
|
// 右击事件
|
||||||
|
window.addEventListener('contextmenu', function (e) {
|
||||||
|
if (e.button === 2) {
|
||||||
|
console.log("点击了鼠标右键");
|
||||||
|
}
|
||||||
|
});
|
||||||
// document.addEventListener("mousemove", onMouseMove);
|
// document.addEventListener("mousemove", onMouseMove);
|
||||||
});
|
});
|
||||||
let scene, renderer, camera, controls, pointsArr = true;
|
let scene, renderer, camera, controls, pointsArr = true;
|
||||||
|
@ -117,7 +123,7 @@ const loadSence = () => {
|
||||||
const dracoLoader = new DRACOLoader();
|
const dracoLoader = new DRACOLoader();
|
||||||
dracoLoader.setDecoderPath('/draco/gltf/')//设置解压库文件路径
|
dracoLoader.setDecoderPath('/draco/gltf/')//设置解压库文件路径
|
||||||
gltfLoader.setDRACOLoader(dracoLoader)
|
gltfLoader.setDRACOLoader(dracoLoader)
|
||||||
gltfLoader.load('/jzc/scene3.gltf', (gltf) => {
|
gltfLoader.load('/jzc/scene.gltf', (gltf) => {
|
||||||
var model = gltf.scene;
|
var model = gltf.scene;
|
||||||
roamdObjects = model.children[0].children;
|
roamdObjects = model.children[0].children;
|
||||||
scene.add(model);
|
scene.add(model);
|
||||||
|
@ -386,9 +392,9 @@ const removeLabel = () => {
|
||||||
|
|
||||||
// 设置地板
|
// 设置地板
|
||||||
const setBottom = () => {
|
const setBottom = () => {
|
||||||
var target = scene.getObjectByName('set1');
|
var target = scene.getObjectByName('floor2F');
|
||||||
|
console.log(target);
|
||||||
if (isRemoveBottom.value) {
|
if (isRemoveBottom.value) {
|
||||||
var target = scene.getObjectByName('set1');
|
|
||||||
target.visible = false;
|
target.visible = false;
|
||||||
} else {
|
} else {
|
||||||
target.visible = true;
|
target.visible = true;
|
||||||
|
|
Loading…
Reference in New Issue