1
0

Memory.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <script setup lang="ts">
  2. import { TresCanvas } from '@tresjs/core'
  3. import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
  4. import { TresLeches, useControls } from '@tresjs/leches'
  5. import '@tresjs/leches/styles'
  6. const gl = {
  7. clearColor: '#fff',
  8. shadows: true,
  9. alpha: false,
  10. shadowMapType: BasicShadowMap,
  11. outputColorSpace: SRGBColorSpace,
  12. toneMapping: NoToneMapping,
  13. }
  14. const { isVisible } = useControls({
  15. isVisible: true,
  16. })
  17. /* const mesh = new Mesh(
  18. new BoxGeometry(),
  19. new MeshToonMaterial({ color: 0x00ff00 }),
  20. )
  21. */
  22. onUnmounted(() => {
  23. // dispose(mesh)
  24. })
  25. </script>
  26. <template>
  27. <RouterLink to="/basic">
  28. Go to another page
  29. </RouterLink>
  30. <TresLeches />
  31. <TresCanvas v-bind="gl">
  32. <TresPerspectiveCamera
  33. :position="[3, 3, 3]"
  34. :look-at="[0, 0, 0]"
  35. />
  36. <TresGroup v-if="isVisible">
  37. <TresMesh :position="[0, 0, 0]">
  38. <TresBoxGeometry />
  39. <TresMeshToonMaterial :color="0x00FF00" />
  40. </TresMesh>
  41. </TresGroup>
  42. <!-- <Suspense> -->
  43. <!-- <BlenderC -->ube v-if="isVisible" />
  44. <!-- </Suspense> -->
  45. <!-- <TresMesh :position="[0,0,0]" v-if="isVisible">
  46. <TresBoxGeometry />
  47. <TresMeshToonMaterial :color="0x00ff00" />
  48. </TresMesh> -->
  49. <!-- <TresGridHelper /> -->
  50. <!-- <TresGroup v-if="isVisible">
  51. <TresMesh :position="[0,0,0]" >
  52. <TresBoxGeometry />
  53. <TresMeshToonMaterial :color="0x00ff00" />
  54. </TresMesh>
  55. </TresGroup> -->
  56. <TresAmbientLight :intensity="1" />
  57. </TresCanvas>
  58. </template>