Skip to content

Commit e7d8516

Browse files
author
Matthew Oxley
committed
initial commit
1 parent 0c6efe6 commit e7d8516

9 files changed

+548
-31
lines changed

package-lock.json

+202-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
"@testing-library/jest-dom": "^5.12.0",
1212
"@testing-library/react": "^11.2.7",
1313
"@testing-library/user-event": "^12.8.3",
14+
"@types/jest": "^27.0.2",
15+
"@types/node": "^16.11.7",
16+
"@types/react": "^17.0.34",
17+
"@types/react-dom": "^17.0.11",
1418
"aphrodite": "^2.4.0",
19+
"camera-controls": "^1.33.1",
1520
"react": "^17.0.2",
1621
"react-dom": "^17.0.2",
1722
"react-scripts": "4.0.3",
1823
"three": "^0.128.0",
24+
"typescript": "^4.4.4",
1925
"web-vitals": "^1.1.2",
2026
"zustand": "^3.5.1"
2127
},
@@ -42,5 +48,8 @@
4248
"last 1 firefox version",
4349
"last 1 safari version"
4450
]
51+
},
52+
"devDependencies": {
53+
"@types/three": "^0.134.0"
4554
}
4655
}

src/App.js

+30-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1-
import './App.css';
2-
import Box from './components/Box';
3-
import { OrbitControls, Stats } from '@react-three/drei';
4-
import { Canvas } from '@react-three/fiber';
1+
import "./App.css";
2+
import React from "react";
3+
import Box from "./components/Box";
4+
import { OrthographicCamera, OrbitControls } from "@react-three/drei";
5+
import { Stats } from "@react-three/drei";
6+
import { Canvas } from "@react-three/fiber";
7+
import OrthographicNavigationControls from "./OrthographicNavigationControls";
58

69
function App() {
7-
8-
10+
const myCamera = React.useRef();
911
return (
1012
<>
11-
<Canvas>
12-
<ambientLight />
13-
<pointLight position={[10, 10, 10]} />
14-
<OrbitControls />
15-
<Box position={[-1.2, 0, 0]} />
16-
<Box position={[1.2, 0, 0]} />
17-
<Stats />
18-
</Canvas>
13+
<Canvas>
14+
<ambientLight />
15+
<axesHelper args={[10]} />
16+
<pointLight position={[10, 10, 10]} />
17+
<>
18+
<OrthographicCamera
19+
position={[0, 0, 3]} // Z is up in CAD land
20+
// up={[0, 0, 1]} // Z is up in CAD land
21+
makeDefault={true}
22+
far={1000}
23+
// left={-5}
24+
// right={5}
25+
near={0.1}
26+
zoom={100}
27+
userData={{ main2d: true }}
28+
ref={myCamera}
29+
/>
30+
<OrbitControls camera={myCamera.current} />
31+
</>
32+
<Box position={[0, 0, 0]} camera={myCamera}/>
33+
<Stats />
34+
</Canvas>
1935
</>
2036
);
2137
}

0 commit comments

Comments
 (0)