rsnext/examples/with-three-js/pages/boxes.js
Henrik Wenz a18c3c2493
Update with-three-js example (#24857)
## Changes

- Update dependencies
- Use new `useAnimations` hook
- Remove next-transpile-modules in favour of drei
- Refactor Components
- Remove dynamic import
- Enable webpack5 (by removing `next.config.js`)
- Removed missing key warning

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-10 20:23:25 +00:00

20 lines
573 B
JavaScript

import { Canvas } from '@react-three/fiber'
import { OrbitControls } from '@react-three/drei'
import Box from '../components/Box'
export default function BoxesPage() {
return (
<>
<h1>Click on me - Hover me :)</h1>
<Canvas camera={{ position: [0, 0, 35] }}>
<ambientLight intensity={2} />
<pointLight position={[40, 40, 40]} />
<Box position={[10, 0, 0]} />
<Box position={[-10, 0, 0]} />
<Box position={[0, 10, 0]} />
<Box position={[0, -10, 0]} />
<OrbitControls />
</Canvas>
</>
)
}