-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25ad2f1
commit 321a347
Showing
6 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
<script lang="ts"> | ||
import * as THREE from 'three' | ||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader' | ||
import * as SC from 'svelte-cubed' | ||
import { onMount } from 'svelte' | ||
export let dataUrl: string | ||
let model: any | ||
function loadGLTF() { | ||
const loader = new GLTFLoader() | ||
return loader.loadAsync(dataUrl) | ||
} | ||
onMount(() => { | ||
loadGLTF().then((_model) => (model = _model)) | ||
}) | ||
</script> | ||
|
||
<SC.Canvas antialias background={new THREE.Color('oklch(99.7% 0.008766 102.8deg)')}> | ||
<SC.Mesh geometry={new THREE.BoxGeometry()} /> | ||
<SC.Mesh geometry={model} /> | ||
<SC.PerspectiveCamera position={[1, 1, 3]} /> | ||
<SC.OrbitControls enableZoom={false} /> | ||
</SC.Canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters