Using FBXModel
The FBXModel
component is a wrapper around useFBX
composable and accepts the same options as props.
Usage
vue
<script setup lang="ts">
import { FBXModel, OrbitControls } from '@tresjs/cientos'
import { TresCanvas } from '@tresjs/core'
</script>
<template>
<TresCanvas clear-color="#1F90FF">
<TresPerspectiveCamera :position="[11, 11, 11]" />
<OrbitControls />
<Suspense>
<FBXModel
path="https://raw.githubusercontent.com/Tresjs/assets/main/models/fbx/low-poly-truck/Jeep_done.fbx"
:scale="0.025"
/>
</Suspense>
<TresDirectionalLight
:intensity="2"
:position="[3, 3, 3]"
/>
<TresAmbientLight />
</TresCanvas>
</template>
Props
Prop | Description | Default |
---|---|---|
path | Path to the model file. | undefined |
castShadow | Apply cast-shadow to all meshes inside your model. | false |
receiveShadow | Apply receive-shadow to all meshes inside your model. | false |