···45454646// 3d components
4747export { default as ModelPicker } from '$lib/components/3d/model-picker/ModelPicker.svelte';
4848+export { default as Depth3D } from '$lib/components/3d/depth3d/Depth3D.svelte';
4949+export { default as VoxelArt } from '$lib/components/3d/voxel-art/VoxelArt.svelte';
···11+<script lang="ts">
22+ import Example from './Example.svelte';
33+</script>
44+55+# Depth 3D
66+77+## Example
88+99+<Example />
1010+1111+## Usage
1212+1313+1. Choose an image (photos of one person in the center work best) and generate a depth map for it for example with [this tool](https://replicate.com/cjwbw/zoedepth)
1414+1515+2. Use component with image and depth map
1616+1717+```svelte
1818+<script lang="ts">
1919+ import { Depth3D } from 'fuchs';
2020+</script>
2121+2222+<Depth3D
2323+ sceneProps={{
2424+ image: {
2525+ image: '/images/image.png',
2626+ depth: '/images/depth.png'
2727+ },
2828+ rounded: 1
2929+ }}
3030+/>
3131+```
3232+
···11+<script lang="ts">
22+ import Example from './Example.svelte';
33+</script>
44+55+# Depth 3D
66+77+## Example
88+99+<Example />
1010+1111+## Usage
1212+1313+Create your voxel art model with [this tool](https://voxels.layoutit.com/), download by clicking the "Download" button and use the component with the downloaded json file.
1414+1515+```svelte
1616+<script lang="ts">
1717+ import { VoxelArt } from 'fuchs';
1818+1919+ import data from '$lib/assets/model.json';
2020+</script>
2121+2222+<VoxelArt {data} />
2323+```
2424+2525+You can also pass a `colorMap` prop to the component to change the colors of the voxel art, e.g. like this:
2626+2727+```svelte
2828+<VoxelArt {data} colorMap={{
2929+ '050505': 'var(--color-accent-50)',
3030+ '101010': 'var(--color-accent-100)',
3131+ '202020': 'var(--color-accent-200)',
3232+ '303030': 'var(--color-accent-300)',
3333+ '404040': 'var(--color-accent-400)',
3434+ '505050': 'var(--color-accent-500)',
3535+}} />
3636+```
3737+3838+## Credits
3939+4040+- inspired by [this article](https://tympanus.net/codrops/2025/03/03/css-meets-voxel-art-building-a-rendering-engine-with-stacked-grids/)