1
0

FirstSceneLightToon.vue 746 B

12345678910111213141516171819202122232425
  1. <script setup lang="ts">
  2. import { TresCanvas } from '@tresjs/core'
  3. /* import { OrbitControls } from '@tresjs/cientos' */
  4. const styles = {
  5. width: '100%',
  6. height: '550px',
  7. border: '1px solid #e2e2e2',
  8. borderRadius: '8px',
  9. overflow: 'hidden',
  10. }
  11. </script>
  12. <template>
  13. <ClientOnly>
  14. <TresCanvas shadows clear-color="#fff" :style="styles">
  15. <TresPerspectiveCamera :position="[0, 2, 4]" />
  16. <OrbitControls />
  17. <TresDirectionalLight :position="[0, 2, 4]" :intensity="2" cast-shadow />
  18. <TresMesh :rotation="[-Math.PI / 4, -Math.PI / 4, Math.PI / 4]">
  19. <TresTorusGeometry :args="[1, 0.5, 16, 32]" />
  20. <TresMeshToonMaterial color="#FBB03B" />
  21. </TresMesh>
  22. </TresCanvas>
  23. </ClientOnly>
  24. </template>