|
@@ -25,12 +25,10 @@ const { scene } = await useLoader(GLTFLoader, '/models/AkuAku.gltf')
|
|
|
|
|
|
Then you can pass the model scene to a `TresMesh` component:
|
|
|
|
|
|
-```html{4}
|
|
|
+```html{3}
|
|
|
<Suspense>
|
|
|
<TresCanvas>
|
|
|
- <TresScene>
|
|
|
<TresMesh v-bind="scene" />
|
|
|
- </TresScene>
|
|
|
</TresCanvas>
|
|
|
</Suspense>
|
|
|
```
|
|
@@ -59,21 +57,19 @@ const { scene } = await useGLTF('/models/AkuAku.gltf', { draco: true })
|
|
|
|
|
|
The `GLTFModel` component is a wrapper around `useGLTF` that's available from [@tresjs/cientos](https://github.com/Tresjs/tres/tree/main/packages/cientos) package.
|
|
|
|
|
|
-```vue{2,10}
|
|
|
+```vue{2,9}
|
|
|
<script setup lang="ts">
|
|
|
import { OrbitControls, GLTFModel } from '@tresjs/cientos'
|
|
|
</script>
|
|
|
<template>
|
|
|
- <Suspense>
|
|
|
- <TresCanvas clear-color="#82DBC5" shadows alpha>
|
|
|
- <TresPerspectiveCamera :position="[11, 11, 11]" />
|
|
|
- <OrbitControls />
|
|
|
- <TresScene>
|
|
|
- <GLTFModel path="/models/AkuAku.gltf" draco />
|
|
|
- <TresDirectionalLight :position="[-4, 8, 4]" :intensity="1.5" cast-shadow />
|
|
|
- </TresScene>
|
|
|
- </TresCanvas>
|
|
|
- </Suspense>
|
|
|
+ <TresCanvas clear-color="#82DBC5" shadows alpha>
|
|
|
+ <TresPerspectiveCamera :position="[11, 11, 11]" />
|
|
|
+ <OrbitControls />
|
|
|
+ <Suspense>
|
|
|
+ <GLTFModel path="/models/AkuAku.gltf" draco />
|
|
|
+ <TresDirectionalLight :position="[-4, 8, 4]" :intensity="1.5" cast-shadow />
|
|
|
+ </Suspense>
|
|
|
+ </TresCanvas>
|
|
|
</template>
|
|
|
```
|
|
|
|
|
@@ -91,12 +87,10 @@ const model = await useFBX('/models/AkuAku.fbx')
|
|
|
|
|
|
Then is as straightforward as adding the scene to your scene:
|
|
|
|
|
|
-```html{4}
|
|
|
+```html{3}
|
|
|
<Suspense>
|
|
|
<TresCanvas shadows alpha>
|
|
|
- <TresScene>
|
|
|
<TresMesh v-bind="scene" />
|
|
|
- </TresScene>
|
|
|
</TresCanvas>
|
|
|
</Suspense>
|
|
|
```
|
|
@@ -105,20 +99,18 @@ Then is as straightforward as adding the scene to your scene:
|
|
|
|
|
|
The `FBXModel` component is a wrapper around `useFBX` that's available from [@tresjs/cientos](https://github.com/Tresjs/tres/tree/main/packages/cientos) package. It's similar usage to `GLTFModel`:
|
|
|
|
|
|
-```vue{2,10}
|
|
|
+```vue{2,9}
|
|
|
<script setup lang="ts">
|
|
|
import { OrbitControls, FBXModel } from '@tresjs/cientos'
|
|
|
</script>
|
|
|
<template>
|
|
|
- <Suspense>
|
|
|
<TresCanvas clear-color="#82DBC5" shadows alpha>
|
|
|
<TresPerspectiveCamera :position="[11, 11, 11]" />
|
|
|
<OrbitControls />
|
|
|
- <TresScene>
|
|
|
- <FBXModel path="/models/AkuAku.fbx" />
|
|
|
+ <Suspense>
|
|
|
+ <FBXModel path="/models/AkuAku.fbx" />
|
|
|
+ </Suspense>
|
|
|
<TresDirectionalLight :position="[-4, 8, 4]" :intensity="1.5" cast-shadow />
|
|
|
- </TresScene>
|
|
|
</TresCanvas>
|
|
|
- </Suspense>
|
|
|
</template>
|
|
|
```
|