euler
This commit is contained in:
parent
1680150c5f
commit
fc6cb8b8f6
|
@ -6,6 +6,7 @@ import {
|
||||||
Vector2, Vector3,
|
Vector2, Vector3,
|
||||||
CircleGeometry, MeshBasicMaterial,
|
CircleGeometry, MeshBasicMaterial,
|
||||||
Quaternion, AdditiveBlending,
|
Quaternion, AdditiveBlending,
|
||||||
|
Euler,
|
||||||
} from 'three';
|
} from 'three';
|
||||||
|
|
||||||
import { useTresContext, useSeek, useTexture, useLoop } from '@tresjs/core';
|
import { useTresContext, useSeek, useTexture, useLoop } from '@tresjs/core';
|
||||||
|
@ -261,14 +262,18 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
||||||
|
|
||||||
el.getWorldPosition(target_vector);
|
el.getWorldPosition(target_vector);
|
||||||
target_vector.y = 10;
|
target_vector.y = 10;
|
||||||
controls_targetto.value = target_vector;
|
|
||||||
|
|
||||||
const quaternion = new Quaternion();
|
const quaternion = new Quaternion();
|
||||||
quaternion.setFromAxisAngle(new Vector3(1, 0, 0), -45 * 3 * (Math.PI / 180));
|
quaternion.setFromEuler(new Euler(
|
||||||
quaternion.setFromAxisAngle(new Vector3(0, 1, 0), -45 * 3 * (Math.PI / 180));
|
-45 * 1 * (Math.PI / 180),
|
||||||
// quaternion.setFromAxisAngle(new Vector3(0, 0, 1), -15 * (Math.PI / 180));
|
35 * 1 * (Math.PI / 180),
|
||||||
|
35 * 1 * (Math.PI / 180)
|
||||||
|
));
|
||||||
|
// quaternion.setFromAxisAngle(new Vector3(0, 1, 0).normalize(), 45 * 4 * (Math.PI / 180));
|
||||||
|
// quaternion.setFromAxisAngle(new Vector3(0, 0, 1).normalize(), -45 * 4 * (Math.PI / 180));
|
||||||
|
|
||||||
camera_rotatetoto.value = quaternion
|
camera_rotatetoto.value = quaternion
|
||||||
|
controls_targetto.value = target_vector;
|
||||||
camera_moveto.value = target_vector;
|
camera_moveto.value = target_vector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -306,15 +311,12 @@ onAfterRender(() => {
|
||||||
// camera.value?.lookAt(camera_moveto.value)
|
// camera.value?.lookAt(camera_moveto.value)
|
||||||
camera_moveto.value = undefined;
|
camera_moveto.value = undefined;
|
||||||
camera_moveto_count.value = COUNT;
|
camera_moveto_count.value = COUNT;
|
||||||
|
|
||||||
// (controls.value as any).maxDistance = targetDistance.max;
|
|
||||||
// (controls.value as any).minDistance = targetDistance.min;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!controls_targetto.value && !camera_moveto.value && camera_rotatetoto.value) {
|
if (!controls_targetto.value && !camera_moveto.value && camera_rotatetoto.value) {
|
||||||
timer.stopTimer();
|
timer.stopTimer();
|
||||||
// camera.value?.quaternion.slerp(camera_rotatetoto.value, 0.5);
|
camera.value?.quaternion.slerp(camera_rotatetoto.value, 0.5);
|
||||||
// camera.value?.quaternion.normalize()
|
camera.value?.quaternion.normalize()
|
||||||
camera_rotatetoto_count.value -= 1;
|
camera_rotatetoto_count.value -= 1;
|
||||||
if (camera_rotatetoto_count.value == 0) {
|
if (camera_rotatetoto_count.value == 0) {
|
||||||
camera_rotatetoto_count.value = 10;
|
camera_rotatetoto_count.value = 10;
|
||||||
|
|
Loading…
Reference in New Issue