-
-
Save martinwairegi/ef987e40864e28265699a426e44d3bda to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import { Canvas } from 'react-three-fiber'; | |
import { Sky } from 'drei'; | |
import { Physics } from 'use-cannon'; | |
import { Ground } from './components/Ground'; | |
import Cubes from './components/Cubes'; | |
import { Player } from './components/Player'; | |
import { Hud } from './components/Hud'; | |
function App() { | |
return ( | |
<Canvas shadowMap sRGB> | |
<Sky sunPosition={[100, 20, 100]} /> | |
<ambientLight intensity={0.25} /> | |
<pointLight castShadow intensity={0.7} position={[100, 100, 100]} /> | |
<Hud position={[0, 0, -2]} /> | |
<Physics gravity={[0, -30, 0]}> | |
<Ground position={[0, 0.5, 0]} /> | |
<Player position={[0, 3, 10]} /> | |
<Cubes /> | |
</Physics> | |
</Canvas> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment