From ee2a26907c7e6107655d4d811dd5cb1b5ed4e448 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Thu, 6 Feb 2025 12:57:14 +0300 Subject: [PATCH] new exp --- components/model/diagram.vue | 54 +++++++++++++++--- components/model/fence.vue | 23 ++------ pages/index.vue | 2 +- public/models_aristo_exp/kosynka.glb | Bin 0 -> 43412 bytes .../models_aristo_exp/krepleniye_planok.glb | Bin 0 -> 5804 bytes public/models_aristo_exp/osnova_stolba.glb | Bin 0 -> 73764 bytes public/models_aristo_exp/planki.glb | Bin 0 -> 213128 bytes public/models_aristo_exp/stolb.glb | Bin 0 -> 6004 bytes public/models_aristo_exp/verh.glb | Bin 0 -> 10740 bytes public/models_one/lamel_100_aristo.glb | Bin 2820 -> 2824 bytes 10 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 public/models_aristo_exp/kosynka.glb create mode 100644 public/models_aristo_exp/krepleniye_planok.glb create mode 100644 public/models_aristo_exp/osnova_stolba.glb create mode 100644 public/models_aristo_exp/planki.glb create mode 100644 public/models_aristo_exp/stolb.glb create mode 100644 public/models_aristo_exp/verh.glb diff --git a/components/model/diagram.vue b/components/model/diagram.vue index 3844897..6c93592 100644 --- a/components/model/diagram.vue +++ b/components/model/diagram.vue @@ -4,6 +4,7 @@ import { useGLTF } from '@tresjs/cientos' import { getColorHexFromRal } from '../ral'; const explosion_state = use_explosion_state() +const globalFenceType = useGlobalFenceType() const k = 1.5 const targetExplosion = { @@ -14,24 +15,59 @@ const targetExplosion = { stolb: [0 * k, 0 * k, 1 * k], verh: [0 * k, 0.25 * k, 0 * k], } +const { scene: standart_kosynka } = await useGLTF('/models_exp/kosynka.glb') +const { scene: standart_krepleniye_planok } = await useGLTF('/models_exp/krepleniye_planok.glb') +const { scene: standart_osnova_stolba } = await useGLTF('/models_exp/osnova_stolba.glb') +const { scene: standart_planki } = await useGLTF('/models_exp/planki.glb') +const { scene: standart_stolb } = await useGLTF('/models_exp/stolb.glb') +const { scene: standart_verh } = await useGLTF('/models_exp/verh.glb') + +const { scene: aristo_kosynka } = await useGLTF('/models_aristo_exp/kosynka.glb') +const { scene: aristo_krepleniye_planok } = await useGLTF('/models_aristo_exp/krepleniye_planok.glb') +const { scene: aristo_osnova_stolba } = await useGLTF('/models_aristo_exp/osnova_stolba.glb') +const { scene: aristo_planki } = await useGLTF('/models_aristo_exp/planki.glb') +const { scene: aristo_stolb } = await useGLTF('/models_aristo_exp/stolb.glb') +const { scene: aristo_verh } = await useGLTF('/models_aristo_exp/verh.glb') + +const kosynka = ref(standart_kosynka) +const krepleniye_planok = ref(standart_krepleniye_planok) +const osnova_stolba = ref(standart_osnova_stolba) +const planki = ref(standart_planki) +const stolb = ref(standart_stolb) +const verh = ref(standart_verh) + +watch(() => globalFenceType.value?.type, (t) => { + if (t == 'aristo') { + kosynka.value = aristo_kosynka + krepleniye_planok.value = aristo_krepleniye_planok + osnova_stolba.value = aristo_osnova_stolba + planki.value = aristo_planki + stolb.value = aristo_stolb + verh.value = aristo_verh + } + if (t == "standart") { + kosynka.value = standart_kosynka + krepleniye_planok.value = standart_krepleniye_planok + osnova_stolba.value = standart_osnova_stolba + planki.value = standart_planki + stolb.value = standart_stolb + verh.value = standart_verh + } + set_material(planki.value, getColorHexFromRal(lamelle_color.value)); + [stolb, verh, krepleniye_planok].map(el => set_material(el.value, getColorHexFromRal(pillar_color.value))) +}) -const { scene: kosynka } = await useGLTF('/models_exp/kosynka.glb') -const { scene: krepleniye_planok } = await useGLTF('/models_exp/krepleniye_planok.glb') -const { scene: osnova_stolba } = await useGLTF('/models_exp/osnova_stolba.glb') -const { scene: planki } = await useGLTF('/models_exp/planki.glb') -const { scene: stolb } = await useGLTF('/models_exp/stolb.glb') -const { scene: verh } = await useGLTF('/models_exp/verh.glb') const lamelle_color = use_lamelle_color() const pillar_color = use_pillar_color() -set_material(planki, getColorHexFromRal(lamelle_color.value)); -[stolb, verh, krepleniye_planok].map(el => set_material(el, getColorHexFromRal(pillar_color.value))) +set_material(planki.value, getColorHexFromRal(lamelle_color.value)); +[stolb, verh, krepleniye_planok].map(el => set_material(el.value, getColorHexFromRal(pillar_color.value)))