FirstSceneLightToon.vue 745 B

1234567891011121314151617181920212223242526
  1. <script setup lang="ts">
  2. import { OrbitControls } from '@tresjs/cientos'
  3. const styles = {
  4. width: '100%',
  5. height: '550px',
  6. border: '1px solid #e2e2e2',
  7. borderRadius: '8px',
  8. overflow: 'hidden',
  9. }
  10. </script>
  11. <template>
  12. <ClientOnly>
  13. <TresCanvas shadows clear-color="#fff" :style="styles">
  14. <TresPerspectiveCamera :position="[0, 2, 4]" />
  15. <OrbitControls />
  16. <TresScene>
  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. </TresScene>
  23. </TresCanvas>
  24. </ClientOnly>
  25. </template>