Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/threlte-vr-code-editor. proof of concept for a live 3d code editor in vr
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455<!--Auto-generated by: https://github.com/threlte/threlte/tree/main/packages/gltfCommand: npx @threlte/gltf@2.0.1 static/planet.gltf -t -T--><script lang="ts"> import * as THREE from 'three'; import { Group } from 'three'; import { T, type Props, type Events, type Slots, forwardEventHandlers } from '@threlte/core'; import { useGltf } from '@threlte/extras';
type $$Props = Props<THREE.Group>; type $$Events = Events<THREE.Group>; type $$Slots = Slots<THREE.Group> & { fallback: {}; error: { error: any } };
export const ref = new Group();
type GLTFResult = { nodes: { mesh_0: THREE.Mesh; mesh_1: THREE.Mesh; }; materials: {}; };
const gltf = useGltf<GLTFResult>('/planet-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.mesh_0.geometry} material={gltf.nodes.mesh_0.material} material.envMapIntensity={0.3} material.opacity={1.0} material.transparent={false} material.flatShading={true} > <T.Mesh geometry={gltf.nodes.mesh_1.geometry} material={gltf.nodes.mesh_1.material} material.transparent={true} material.flatShading={true} /> </T.Mesh> {:catch error} <slot name="error" {error} /> {/await}
<slot {ref} /></T>