bx-1379-redesign #15
Binary file not shown.
|
@ -25,6 +25,7 @@ import { useTimer } from '../../stores/timer';
|
||||||
import { useRawData } from '../../stores/raw_data';
|
import { useRawData } from '../../stores/raw_data';
|
||||||
import { useTimerHome } from '../../stores/timer_home';
|
import { useTimerHome } from '../../stores/timer_home';
|
||||||
import { useItem } from '../../stores/item';
|
import { useItem } from '../../stores/item';
|
||||||
|
import { hsl } from 'd3';
|
||||||
|
|
||||||
const props = defineProps(['source', 'loaded_pan', 'push'])
|
const props = defineProps(['source', 'loaded_pan', 'push'])
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ const itemStore = useItem();
|
||||||
const { controls, camera, scene, raycaster, renderer } = useTresContext()
|
const { controls, camera, scene, raycaster, renderer } = useTresContext()
|
||||||
const { seekByName, seekAllByName } = useSeek()
|
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) => {
|
const set_moveto = (obj: smooth, value: Vector3 | Quaternion | undefined) => {
|
||||||
obj.value = value
|
obj.value = value
|
||||||
|
@ -179,7 +180,16 @@ const loadModels = async () => {
|
||||||
const p = raw_dataStore.data.min_distance * 0.05;
|
const p = raw_dataStore.data.min_distance * 0.05;
|
||||||
const point = point_mesh_obj.clone()
|
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.updateMatrixWorld()
|
||||||
point.name = `${element.id}_clickable`
|
point.name = `${element.id}_clickable`
|
||||||
|
@ -302,7 +312,7 @@ onAfterRender(() => {
|
||||||
|
|
||||||
const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position);
|
const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position);
|
||||||
if (dis_to_cam) {
|
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].children[0].scale.set(scaling, scaling, scaling);
|
||||||
el.value[0].updateMatrixWorld()
|
el.value[0].updateMatrixWorld()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue