Skip to content

Commit

Permalink
Add Luma example
Browse files Browse the repository at this point in the history
adeira-source-id: 05bb91e0683170c3a9886ef36afed854e9a18e3b
  • Loading branch information
itsdouges authored and triplex-bot committed Dec 8, 2023
1 parent 74814b1 commit 60df666
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 15 deletions.
2 changes: 0 additions & 2 deletions examples/caustics/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions examples/faze/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions examples/geometry/.gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions examples/luma-splats/.triplex/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://triplex.dev/config.schema.json",
"components": ["../src/geometry/**/*.tsx"],
"files": ["../src/**/*.tsx"]
}
20 changes: 20 additions & 0 deletions examples/luma-splats/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@example/luma-splats",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "echo \"Not implemented\"",
"typedef": "echo \"Not implemented\""
},
"dependencies": {
"@lumaai/luma-web": "^0.1.14",
"@react-three/drei": "^9.56.27",
"@react-three/fiber": "^8.14.5",
"@react-three/rapier": "^1.1.1",
"@types/react": "^18.0.0",
"@types/three": "^0.157.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"three": "^0.157.0"
}
}
29 changes: 29 additions & 0 deletions examples/luma-splats/src/scene.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright (c) Michael Dougall. All rights reserved.
*
* This source code is licensed under the GPL-3.0 license found in the LICENSE
* file in the root directory of this source tree.
*/
import { LumaSplatsSemantics, LumaSplatsThree } from "@lumaai/luma-web";
import { extend, Object3DNode } from "@react-three/fiber";

extend({ LumaSplats: LumaSplatsThree });

declare module "@react-three/fiber" {
interface ThreeElements {
lumaSplats: Object3DNode<LumaSplatsThree, typeof LumaSplatsThree>;
}
}

export function Scene() {
return (
<>
<lumaSplats
position={[-1, 0, 0]}
scale={0.5}
semanticsMask={LumaSplatsSemantics.FOREGROUND}
source="https://lumalabs.ai/capture/822bac8d-70d6-404e-aaae-f89f46672c67"
/>
</>
);
}
23 changes: 23 additions & 0 deletions examples/luma-splats/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "es2022"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"paths": {
"@/*": ["./src/*"]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"types": ["@react-three/fiber"]
},
"include": ["."],
"exclude": ["node_modules"]
}
3 changes: 0 additions & 3 deletions examples/magic-box/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions examples/mecha/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions examples/room/.gitignore

This file was deleted.

0 comments on commit 60df666

Please sign in to comment.