diff --git a/front/src/components/Promo/load_models.vue b/front/src/components/Promo/load_models.vue index d2e3845..6d3d894 100644 --- a/front/src/components/Promo/load_models.vue +++ b/front/src/components/Promo/load_models.vue @@ -36,7 +36,7 @@ const targetDistance = reactive({ max: 10, min: 0 }) let sidebar_clickable = [] as PromoScene[] let sidebar_visible = [] as PromoScene[] -const COUNT = 30 +const COUNT = 50 type smooth = { value: Vector3 | Quaternion | undefined, count: number @@ -232,8 +232,6 @@ const loadModels = async () => { if (controls.value && (controls.value as any).autoRotate) { (controls.value as any).autoRotate = false; } - - // process_loading.value = null } const gotoCenterAndDistance = () => { @@ -253,7 +251,6 @@ watch(() => props.source, () => { } console.log('props change') sidebar.close() - // loadModels() } else { renderer.value.dispose() } @@ -279,8 +276,11 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => { target_vector.setComponent(1, targetDistance.min) set_moveto(smooth_target, target_vector) - // set_moveto(smooth_move, target_vector.multiply(new Vector3(1.25, 1, 1.25).setY(targetDistance.min))) - set_moveto(smooth_move, new Vector3(targetDistance.min, targetDistance.min, targetDistance.min)) + set_moveto(smooth_move, new Vector3( + (target_vector.x / Math.abs(target_vector.x)) * targetDistance.min, + 0, + (target_vector.z / Math.abs(target_vector.z)) * targetDistance.min + )) } } }, { deep: true }) @@ -302,8 +302,8 @@ onBeforeRender(() => { } } }) - // const koef = (1 / COUNT) * 3 - const koef = 0.05 + const koef = (1 / COUNT) * 3 + // const koef = 0.05 if (smooth_target.value || smooth_move.value) { timer.resetTimer() home_timer.resetTimer()