BlenderCube.vue 422 B

123456789101112131415161718
  1. <script setup lang="ts">
  2. import { useTresContext } from '@tresjs/core'
  3. import { useGLTF } from '@tresjs/cientos'
  4. const { nodes } = await useGLTF('https://raw.githubusercontent.com/Tresjs/assets/main/models/gltf/blender-cube.glb',
  5. { draco: true })
  6. const model = nodes.Cube
  7. model.position.set(0, 1, 0)
  8. const state = useTresContext()
  9. state.invalidate()
  10. </script>
  11. <template>
  12. <primitive :object="model" />
  13. </template>