orbit controls test

This commit is contained in:
Kseninia Mikhaylova 2024-06-27 16:51:28 +03:00
parent b69787e531
commit 04cb01a1f9
2 changed files with 6 additions and 6 deletions

View File

@ -42,8 +42,8 @@ const loadModels = async () => {
(controls.value as any).maxDistance = raw_data.max_distance;
(controls.value as any)._needsUpdate = true;
(controls.value as any).update(1)
// camera.value?.position.copy(new Vector3(0, 0, 0));
// camera.value?.lookAt(new Vector3(0, 0, 0));
camera.value?.position.set(1,1,1);
camera.value?.lookAt(new Vector3(1,1,1));
for (let index = 0; index < data.length; index++) {
const element = data[index];

View File

@ -5,7 +5,7 @@ import { useRoute } from 'vue-router';
import { PointLight, Vector3 } from 'three';
import { TresCanvas } from '@tresjs/core';
import { CameraControls, useProgress, StatsGl, OrbitControls } from '@tresjs/cientos'
import { CameraControls, useProgress, StatsGl, OrbitControls, MapControls } from '@tresjs/cientos'
import Env from './env.vue'
import LoadModels from './load_models.vue'
@ -27,15 +27,15 @@ const camera = ref()
const cameraPosition = ref([1, 1, 1]) as unknown as Ref<Vector3>
const controlsState = reactive({
maxPolarAngle: (Math.PI / 2) - 0.02,
enableZoom: false,
// maxPolarAngle: (Math.PI / 2) - 0.02,
// enableZoom: false,
})
const models_loading = ref(false)
const set_model_load_status = () =>{
models_loading.value = !models_loading.value
}
const point_light = new PointLight('#f0f', 1000, 200)
const point_light = new PointLight('#00d', 1000, 200)
point_light.intensity = 10000
point_light.position.set(-100, 100, 5)
point_light.castShadow = true