order | category | name | sourcePath | type | componentSignature | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7.12 |
@threlte/extras |
<Billboard> |
packages/extras/src/lib/components/Billboard/Billboard.svelte |
component |
|
This component is a port of drei's <Billboard>
component which rotates its contents
to always face the camera.
<script lang="ts">
import { T } from '@threlte/core'
import { Billboard } from '@threlte/extras'
</script>
<Billboard>
<T.Mesh>
<T.MeshStandardMaterial />
<T.PlaneGeometry args={[2, 2]} />
</T.Mesh>
</Billboard>
To disable the billboard from rotating its contents to face the camera, you can
optionally pass in a follow
prop set to false
.
You can also optionally pass in a lockX
, lockY
, or lockZ
prop to lock the
rotation of the billboard on a specific axis.
<script lang="ts">
import { T } from '@threlte/core'
import { Billboard } from '@threlte/extras'
</script>
<Billboard lockX>
<T.Mesh>
<T.MeshStandardMaterial />
<T.PlaneGeometry args={[2, 2]} />
</T.Mesh>
</Billboard>