diff --git a/front/src/assets/pointer/point-v1-v1.glb b/front/src/assets/pointer/point-v1-v1.glb new file mode 100644 index 0000000..487e20d Binary files /dev/null and b/front/src/assets/pointer/point-v1-v1.glb differ diff --git a/front/src/components/Promo/load_models.vue b/front/src/components/Promo/load_models.vue index 6e686da..706d776 100644 --- a/front/src/components/Promo/load_models.vue +++ b/front/src/components/Promo/load_models.vue @@ -25,6 +25,7 @@ import { useTimer } from '../../stores/timer'; import { useRawData } from '../../stores/raw_data'; import { useTimerHome } from '../../stores/timer_home'; import { useItem } from '../../stores/item'; +import { hsl } from 'd3'; const props = defineProps(['source', 'loaded_pan', 'push']) @@ -59,7 +60,7 @@ const itemStore = useItem(); const { controls, camera, scene, raycaster, renderer } = useTresContext() const { seekByName, seekAllByName } = useSeek() -const { scene: point_mesh_obj } = await useGLTF((await import('../../assets/pointer/point-v1.glb')).default) +const { scene: point_mesh_obj } = await useGLTF((await import('../../assets/pointer/point-v1-v1.glb')).default) const set_moveto = (obj: smooth, value: Vector3 | Quaternion | undefined) => { obj.value = value @@ -179,7 +180,16 @@ const loadModels = async () => { const p = raw_dataStore.data.min_distance * 0.05; const point = point_mesh_obj.clone() - point.position.set(world_position.x, p * 3, world_position.z * 2) + const hsl_color = { h: 0, s: 0, l: 0 } + new Color(envVars.clear_color).getHSL(hsl_color) + // hsl_color.h = 1 - degrees = radians × 180° / π + console.log(hsl_color) + point_mesh_obj.traverse((el: Group | Mesh) => { + if (el instanceof Mesh && el.material) { + el.material.color = new Color().setHSL(hsl_color.h, hsl_color.s, hsl_color.l) + } + }) + point.position.set(world_position.x, p * 1, world_position.z * 2) point.updateMatrixWorld() point.name = `${element.id}_clickable` @@ -302,7 +312,7 @@ onAfterRender(() => { const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position); if (dis_to_cam) { - const scaling = (1 * dis_to_cam) / 100 + const scaling = (0.5 * dis_to_cam) / 100 el.value[0].children[0].scale.set(scaling, scaling, scaling); el.value[0].updateMatrixWorld() }