BlenderCube.vue 420 B

1234567891011121314151617
  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', { draco: true })
  5. const model = nodes.Cube
  6. model.position.set(0, 1, 0)
  7. const state = useTresContext()
  8. state.invalidate()
  9. </script>
  10. <template>
  11. <primitive :object="model" />
  12. </template>