axesHelper
Video Lecture
Section | Video Links | |
---|---|---|
axesHelper |
Description
The axesHelper is an object to help visualize the 3 axes in a simple way. The X axis is red, the Y axis is green and the Z axis is blue.
The axesHelper
is part of the Three.js core library, and also included by default as part of the Threejs intrinsic elements that are referenced when using the React Three Fiber canvas.
So we can use it straight it of the box.
Now, add,
<axesHelper />
to anywhere within the Canvas
JSX tag, and it will work. Note the lowercase a
in axesHelper
.
The default length of the AxesHelper
arms is one unit. You can pass in an argument to override the length.
E.g., make the arms 5 units long.
<axesHelper args={[5]} />
./src/App.jsx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Working Example
Useful Links
AxesHelper | threejs.org | sbedit.net |
GitHub Branch
git clone https://github.com/Sean-Bradley/React-Three-Fiber-Boilerplate.git
cd React-Three-Fiber-Boilerplate
git checkout axesHelper
npm install
npm start