FirstSceneLightToon.vue 801 B

1234567891011121314151617181920212223242526272829303132333435
  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
  15. shadows
  16. clear-color="#fff"
  17. :style="styles"
  18. >
  19. <TresPerspectiveCamera :position="[0, 2, 4]" />
  20. <OrbitControls />
  21. <TresDirectionalLight
  22. :position="[0, 2, 4]"
  23. :intensity="2"
  24. cast-shadow
  25. />
  26. <TresMesh :rotation="[-Math.PI / 4, -Math.PI / 4, Math.PI / 4]">
  27. <TresTorusGeometry :args="[1, 0.5, 16, 32]" />
  28. <TresMeshToonMaterial color="#FBB03B" />
  29. </TresMesh>
  30. </TresCanvas>
  31. </ClientOnly>
  32. </template>