Tweakpane.story.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <script setup lang="ts">
  2. import { Color } from 'three'
  3. import { OrbitControls, useTweakPane } from '@tresjs/cientos'
  4. useTweakPane()
  5. const floorTeal = new Color('gray')
  6. </script>
  7. <template>
  8. <Story title="GUI/TweakPane">
  9. <Variant title="playground">
  10. <TresCanvas clear-color="#82DBC5" shadows alpha>
  11. <TresPerspectiveCamera :position="[11, 11, 11]" />
  12. <OrbitControls />
  13. <TresScene>
  14. <TresMesh :position="[-2, 6, 0]" :rotation="[0, Math.PI, 0]" cast-shadow>
  15. <TresConeGeometry :args="[1, 1.5, 3]" />
  16. <TresMeshToonMaterial color="#82DBC5" />
  17. </TresMesh>
  18. <TresMesh :position="[0, 4, 0]" cast-shadow>
  19. <TresBoxGeometry :args="[1.5, 1.5, 1.5]" />
  20. <TresMeshToonMaterial color="#4F4F4F" />
  21. </TresMesh>
  22. <TresMesh :position="[2, 2, 0]" cast-shadow>
  23. <TresSphereGeometry />
  24. <TresMeshToonMaterial color="#FBB03B" />
  25. </TresMesh>
  26. <TresDirectionalLight :position="[0, 8, 4]" :intensity="0.7" cast-shadow />
  27. <TresMesh :rotation="[-Math.PI / 2, 0, 0]" receive-shadow>
  28. <TresPlaneGeometry :args="[10, 10, 10, 10]" />
  29. <TresMeshToonMaterial :color="floorTeal" />
  30. </TresMesh>
  31. </TresScene>
  32. </TresCanvas>
  33. </Variant>
  34. </Story>
  35. </template>