diff --git a/front/src/assets/pointer/Point_isom_1.png b/front/src/assets/pointer/Point_isom_1.png deleted file mode 100644 index 614d20a..0000000 Binary files a/front/src/assets/pointer/Point_isom_1.png and /dev/null differ diff --git a/front/src/assets/pointer/point-v1.glb b/front/src/assets/pointer/point-v1.glb new file mode 100644 index 0000000..cc2ce33 Binary files /dev/null and b/front/src/assets/pointer/point-v1.glb differ diff --git a/front/src/components/Promo/load_models.vue b/front/src/components/Promo/load_models.vue index a6e136f..6e686da 100644 --- a/front/src/components/Promo/load_models.vue +++ b/front/src/components/Promo/load_models.vue @@ -59,9 +59,7 @@ const itemStore = useItem(); const { controls, camera, scene, raycaster, renderer } = useTresContext() const { seekByName, seekAllByName } = useSeek() -const pointerTexture = await useTexture({ - map: '/pointer_texture.png' -}) +const { scene: point_mesh_obj } = await useGLTF((await import('../../assets/pointer/point-v1.glb')).default) const set_moveto = (obj: smooth, value: Vector3 | Quaternion | undefined) => { obj.value = value @@ -179,27 +177,11 @@ const loadModels = async () => { (find_element as Mesh).localToWorld(world_position); const p = raw_dataStore.data.min_distance * 0.05; - const name = index % 5 - const fileTexture = await import(`../../assets/pointer/${name}.png`); - const pointerTexture = await useTexture({ - map: fileTexture.default - }) - - const point_mesh = new Mesh( - new CircleGeometry(0.5, 32), - new MeshBasicMaterial({ - color: new Color('#fff'), - map: pointerTexture.map, - transparent: true, - blending: AdditiveBlending - }) - ) - point_mesh.rotateX(-0.5 * Math.PI) - - const point = new Group() - point.add(point_mesh) + const point = point_mesh_obj.clone() point.position.set(world_position.x, p * 3, world_position.z * 2) + + point.updateMatrixWorld() point.name = `${element.id}_clickable` if (clickable_items.value.find(el => el.name == point.name)) continue @@ -314,7 +296,9 @@ const { onAfterRender } = useLoop() onAfterRender(() => { clickable_refs.value.map(el => { if (el.value[0] && el.value[0].children) { - el.value[0].children[0].lookAt(camera.value?.position) + el.value[0].children[0].lookAt(camera.value?.position); + el.value[0].children[0].rotateX(90 * (Math.PI / 180)); + el.value[0].children[0].rotateZ(15 * (Math.PI / 180)); const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position); if (dis_to_cam) { @@ -368,7 +352,7 @@ timer.timer_func = () => { sidebar.close(); (controls.value as any).autoRotate = true; (controls.value as any).autoRotateSpeed = 0.5; - + timer.startTimer() home_timer.startTimer() }