[READ-ONLY] Mirror of https://github.com/flo-bit/room. tiny 3d rooms saved locally or in your bluesky account, svelte/threlte flo-bit.dev/room/
0

Configure Feed

Select the types of activity you want to include in your feed.

room / src / lib / models / kenney-furniture-kit / pottedPlant.svelte
2.3 kB 87 lines
1<!-- 2Auto-generated by: https://github.com/threlte/threlte/tree/main/packages/gltf 3Command: npx @threlte/gltf@3.0.0 static/models/pottedPlant.glb -t -s 4--> 5 6<script lang="ts"> 7 import type * as THREE from 'three'; 8 9 import type { Snippet } from 'svelte'; 10 import { T, type Props } from '@threlte/core'; 11 import { useGltf } from '@threlte/extras'; 12 import { base } from '$app/paths'; 13 14 let { 15 fallback, 16 error, 17 children, 18 ref = $bindable(), 19 colors, 20 opacity, 21 ...props 22 }: Props<THREE.Group> & { 23 ref?: THREE.Group; 24 children?: Snippet<[{ ref: THREE.Group }]>; 25 fallback?: Snippet; 26 error?: Snippet<[{ error: Error }]>; 27 colors?: (number | string)[]; 28 opacity?: number; 29 } = $props(); 30 31 type GLTFResult = { 32 nodes: { 33 Mesh_pottedPlant: THREE.Mesh; 34 Mesh_pottedPlant_1: THREE.Mesh; 35 plant: THREE.Mesh; 36 }; 37 materials: { 38 wood: THREE.MeshStandardMaterial; 39 woodDark: THREE.MeshStandardMaterial; 40 plant: THREE.MeshStandardMaterial; 41 }; 42 }; 43 44 const gltf = useGltf<GLTFResult>(base + '/models/kenney-furniture-kit/pottedPlant.glb'); 45</script> 46 47<T.Group bind:ref dispose={false} {...props}> 48 {#await gltf} 49 {@render fallback?.()} 50 {:then gltf} 51 <T.Group scale={2}> 52 <T.Mesh 53 castShadow 54 receiveShadow 55 geometry={gltf.nodes.Mesh_pottedPlant.geometry} 56 material={gltf.materials.wood.clone()} 57 material.color={colors?.[0] ?? gltf.materials.wood.color} 58 material.opacity={opacity ?? gltf.materials.wood.opacity} 59 material.transparent={opacity !== undefined} 60 /> 61 <T.Mesh 62 castShadow 63 receiveShadow 64 geometry={gltf.nodes.Mesh_pottedPlant_1.geometry} 65 material={gltf.materials.woodDark.clone()} 66 material.color={colors?.[1] ?? gltf.materials.woodDark.color} 67 material.opacity={opacity ?? gltf.materials.woodDark.opacity} 68 material.transparent={opacity !== undefined} 69 /> 70 <T.Mesh 71 castShadow 72 receiveShadow 73 geometry={gltf.nodes.plant.geometry} 74 material={gltf.materials.plant.clone()} 75 material.color={colors?.[2] ?? gltf.materials.plant.color} 76 material.opacity={opacity ?? gltf.materials.plant.opacity} 77 material.transparent={opacity !== undefined} 78 position={[-0.05, 0.06, 0.06]} 79 scale={0.5} 80 /> 81 </T.Group> 82 {:catch err} 83 {@render error?.({ error: err })} 84 {/await} 85 86 {@render children?.({ ref })} 87</T.Group>