feat: added threlte & threejs implementations

This commit is contained in:
Bart van der Braak 2023-07-29 14:32:25 +02:00
parent 908499271c
commit d199ec5305
10 changed files with 198 additions and 109 deletions

View file

@ -0,0 +1,29 @@
<!--
Auto-generated by: https://github.com/threlte/threlte/tree/main/packages/gltf
Command: npx @threlte/gltf@1.0.0-next.13 ./src/lib/assets/vectors/github.glb --transform
-->
<script>
import { Group } from 'three';
import { T, forwardEventHandlers } from '@threlte/core';
import { useGltf } from '@threlte/extras';
export const ref = new Group();
const gltf = useGltf('./github-transformed.glb', { useDraco: true });
const component = forwardEventHandlers();
</script>
<T is={ref} dispose={false} {...$$restProps} bind:this={$component}>
{#await gltf}
<slot name="fallback" />
{:then gltf}
<T.Mesh geometry={gltf.nodes.Github_Mesh.geometry}
><T.MeshPhysicalMaterial color={[0,0,0]} /></T.Mesh
>
{:catch error}
<slot name="error" {error} />
{/await}
<slot {ref} />
</T>