Skip to content

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 { TresCanvas } from '@tresjs/core'
import { FBXModel, OrbitControls } from '@tresjs/cientos'
</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

PropDescriptionDefault
pathPath to the model file.undefined
castShadowApply cast-shadow to all meshes inside your model.false
receiveShadowApply receive-shadow to all meshes inside your model.false