|
@@ -13,8 +13,8 @@ import {
|
|
ACESFilmicToneMapping,
|
|
ACESFilmicToneMapping,
|
|
CustomToneMapping,
|
|
CustomToneMapping,
|
|
} from 'three'
|
|
} from 'three'
|
|
-import { reactive } from 'vue'
|
|
|
|
-import { OrbitControls, useTweakPane } from '../../../cientos/src/'
|
|
|
|
|
|
+import { reactive, ref } from 'vue'
|
|
|
|
+import { OrbitControls, useTweakPane, TransformControls } from '../../../cientos/src/'
|
|
import { TresCanvas } from '../core/useRenderer/component'
|
|
import { TresCanvas } from '../core/useRenderer/component'
|
|
/* import { OrbitControls, GLTFModel } from '@tresjs/cientos' */
|
|
/* import { OrbitControls, GLTFModel } from '@tresjs/cientos' */
|
|
|
|
|
|
@@ -28,6 +28,9 @@ const state = reactive({
|
|
toneMapping: NoToneMapping,
|
|
toneMapping: NoToneMapping,
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const boxRef = ref()
|
|
|
|
+const sphereRef = ref()
|
|
|
|
+
|
|
const { pane } = useTweakPane()
|
|
const { pane } = useTweakPane()
|
|
|
|
|
|
pane.addInput(state, 'clearColor', {
|
|
pane.addInput(state, 'clearColor', {
|
|
@@ -93,25 +96,28 @@ pane
|
|
<template>
|
|
<template>
|
|
<TresCanvas v-bind="state">
|
|
<TresCanvas v-bind="state">
|
|
<TresPerspectiveCamera :position="[5, 5, 5]" :fov="45" :near="0.1" :far="1000" :look-at="[-8, 3, -3]" />
|
|
<TresPerspectiveCamera :position="[5, 5, 5]" :fov="45" :near="0.1" :far="1000" :look-at="[-8, 3, -3]" />
|
|
|
|
+ <OrbitControls make-default />
|
|
<TresScene>
|
|
<TresScene>
|
|
- <OrbitControls />
|
|
|
|
<TresAmbientLight :intensity="0.5" />
|
|
<TresAmbientLight :intensity="0.5" />
|
|
<TresMesh :position="[-2, 6, 0]" :rotation="[0, Math.PI, 0]" cast-shadow>
|
|
<TresMesh :position="[-2, 6, 0]" :rotation="[0, Math.PI, 0]" cast-shadow>
|
|
<TresConeGeometry :args="[1, 1.5, 3]" />
|
|
<TresConeGeometry :args="[1, 1.5, 3]" />
|
|
<TresMeshToonMaterial color="#82DBC5" />
|
|
<TresMeshToonMaterial color="#82DBC5" />
|
|
</TresMesh>
|
|
</TresMesh>
|
|
- <TresMesh :position="[0, 4, 0]" cast-shadow>
|
|
|
|
|
|
+ <TransformControls :object="boxRef" />
|
|
|
|
+ <TresMesh ref="boxRef" :position="[0, 4, 0]" cast-shadow>
|
|
<TresBoxGeometry :args="[1.5, 1.5, 1.5]" />
|
|
<TresBoxGeometry :args="[1.5, 1.5, 1.5]" />
|
|
<TresMeshToonMaterial color="#4F4F4F" />
|
|
<TresMeshToonMaterial color="#4F4F4F" />
|
|
</TresMesh>
|
|
</TresMesh>
|
|
- <TresMesh :position="[2, 2, 0]" cast-shadow>
|
|
|
|
|
|
+ <TransformControls :object="sphereRef" />
|
|
|
|
+
|
|
|
|
+ <TresMesh ref="sphereRef" :position="[2, 2, 0]" cast-shadow>
|
|
<TresSphereGeometry />
|
|
<TresSphereGeometry />
|
|
<TresMeshToonMaterial color="#FBB03B" />
|
|
<TresMeshToonMaterial color="#FBB03B" />
|
|
</TresMesh>
|
|
</TresMesh>
|
|
<TresDirectionalLight :position="[0, 8, 4]" :intensity="0.7" cast-shadow />
|
|
<TresDirectionalLight :position="[0, 8, 4]" :intensity="0.7" cast-shadow />
|
|
<TresMesh :rotation="[-Math.PI / 2, 0, 0]" receive-shadow>
|
|
<TresMesh :rotation="[-Math.PI / 2, 0, 0]" receive-shadow>
|
|
<TresPlaneGeometry :args="[10, 10, 10, 10]" />
|
|
<TresPlaneGeometry :args="[10, 10, 10, 10]" />
|
|
- <TresMeshToonMaterial :color="floorTeal" />
|
|
|
|
|
|
+ <TresMeshToonMaterial />
|
|
</TresMesh>
|
|
</TresMesh>
|
|
<TresDirectionalLight :position="[0, 2, 4]" :intensity="1" cast-shadow />
|
|
<TresDirectionalLight :position="[0, 2, 4]" :intensity="1" cast-shadow />
|
|
</TresScene>
|
|
</TresScene>
|