feat: added comments for debugging

This commit is contained in:
Bart van der Braak 2023-07-29 17:42:10 +02:00
parent e35966d7ff
commit de4b638d39
3 changed files with 18 additions and 16 deletions

View file

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

View file

@ -1,3 +1,4 @@
<!-- src/routes/tools/+page.svelte -->
<script lang="ts"> <script lang="ts">
import { Canvas } from '@threlte/core'; import { Canvas } from '@threlte/core';
import Scene from './Scene.svelte'; import Scene from './Scene.svelte';

View file

@ -1,3 +1,4 @@
<!-- src/routes/tools/Scene.svelte -->
<script> <script>
import Github3d from '$lib/components/gltf/Github3d.svelte'; import Github3d from '$lib/components/gltf/Github3d.svelte';
import { T, useFrame } from '@threlte/core'; import { T, useFrame } from '@threlte/core';