add drei to template

This commit is contained in:
Austin Godber 2024-04-14 10:34:55 -07:00
parent b0e9724451
commit e17a4e90ea
3 changed files with 893 additions and 126 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,10 @@
"vite": "^5.2.8"
},
"dependencies": {
"@react-three/drei": "^9.105.4",
"@react-three/fiber": "^8.16.2",
"react": "18.2",
"react-dom": "18.2",
"@react-three/fiber": "^8.16.2",
"three": "^0.163.0"
}
}

View File

@ -1,7 +1,5 @@
import { useThree, extend } from '@react-three/fiber'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
extend({ OrbitControls })
import { OrbitControls } from '@react-three/drei'
export default function Experience()
{
@ -9,7 +7,7 @@ export default function Experience()
return <>
<orbitControls args={ [ camera, gl.domElement ] } />
<OrbitControls />
<directionalLight position={ [ 1, 2, 3 ] } intensity={ 4.5 } />
<ambientLight intensity={ 1.5 } />
@ -21,7 +19,7 @@ export default function Experience()
<mesh position-y={ - 1 } rotation-x={ - Math.PI * 0.5 } scale={ 10 }>
<planeGeometry />
<meshStandardMaterial color="greenyellow" />
<meshStandardMaterial color="grey" />
</mesh>
</>