|
@@ -1,22 +1,23 @@
|
|
|
<script setup lang="ts">
|
|
|
+import { unref } from 'vue'
|
|
|
import { Color } from 'three'
|
|
|
-import { OrbitControls, useTweakPane } from '@tresjs/cientos'
|
|
|
-/* import TestSphere from '/@/components/TestSphere.vue' */
|
|
|
+import { useTweakPane } from '@tresjs/cientos'
|
|
|
+import { useTres } from './core'
|
|
|
+import TestSphere from '/@/components/TestSphere.vue'
|
|
|
|
|
|
-/* import { OrbitControls, useTweakPane } from '@tresjs/cientos' */
|
|
|
-/* import { OrbitControls, useTweakPane } from '../../cientos/src/'
|
|
|
- */
|
|
|
const colorTeal = new Color('teal')
|
|
|
useTweakPane()
|
|
|
|
|
|
-const meshPosition = [2, 1, 0]
|
|
|
+const { state } = useTres()
|
|
|
+
|
|
|
+const meshPosition = [0, 1, 0]
|
|
|
</script>
|
|
|
<template>
|
|
|
<Suspense>
|
|
|
<TresCanvas shadows alpha power-preference="high-performance" preserve-drawing-buffer physically-correct-lights>
|
|
|
- <OrbitControls />
|
|
|
- <TresPerspectiveCamera :position="[5, 5, 5]" :fov="45" :aspect="1" :near="0.1" :far="1000" />
|
|
|
+ <TresPerspectiveCamera :position="[0, 5, 5]" :fov="45" :near="0.1" :far="1000" />
|
|
|
<TresScene>
|
|
|
+ <TresOrbitControls v-if="state.renderer" :args="[unref(state), state.renderer?.domElement]" />
|
|
|
<TresMesh :position="meshPosition" :scale="1">
|
|
|
<TresSphereGeometry />
|
|
|
<TresMeshToonMaterial :color="colorTeal" />
|