|
@@ -1,5 +1,17 @@
|
|
|
<script setup lang="ts">
|
|
|
+import { useRenderLoop } from '/@/core/useRenderLoop'
|
|
|
+import { ref } from 'vue'
|
|
|
import { OrbitControls } from '../../../cientos/src/'
|
|
|
+
|
|
|
+const { onLoop } = useRenderLoop()
|
|
|
+
|
|
|
+const groupRef = ref()
|
|
|
+
|
|
|
+onLoop(() => {
|
|
|
+ if (groupRef.value) {
|
|
|
+ groupRef.value.rotation.y += 0.01
|
|
|
+ }
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="container">
|
|
@@ -8,7 +20,7 @@ import { OrbitControls } from '../../../cientos/src/'
|
|
|
<OrbitControls />
|
|
|
<TresScene>
|
|
|
<TresAmbientLight :color="0xffffff" :intensity="0.5" />
|
|
|
- <TresGroup :position="[0, -4, -5]">
|
|
|
+ <TresGroup ref="groupRef" :position="[0, -4, -5]">
|
|
|
<TresMesh :scale="1" :position="[-4, 0, 0]" cast-shadow>
|
|
|
<TresSphereGeometry :args="[1, 500, 500]" />
|
|
|
<TresMeshToonMaterial color="#FBB03B" />
|