- Clone repository
- Use git to clone the repository using the command below:
git clone https://github.com/t-lawan/threejs-tutorial.gitor use github desktop
- Fork the repository.
- When asked 'How are you planning to use this fork?' select 'For my own purposes'
- Go to directory of cloned repository using the command below:
cd threejs-tutorial- Install package dependencies using the command below
npm install- Run the app in the development mode using the command below:
npm run start- If the broswer did not open automatically, go to http://localhost:3000/ in a web browser
- Open the directory in a text editor (ideally visual studio code)
Look at the fundamental function that set up the environment: renderer, scene and camera
- setupScene()
- new THREE.Scene()
- setupCamera()
- setupRenderer()
- Replace Cube with model
-
Copy model (glb) to src/Assets/Model folder
-
Go populateScene() in Cube Environment
-
Go through the addModel() function
-
Uncomment setupLoadingManager() in setupScene()
PUSH TO GIT
- Make interactive
- Go to setupScene()
- Uncomment setupRayCaster()
- Uncomment setupMouse()
- Go to addEventListener()
- uncomment OnDocumentDoubleClick
- Go to removeEventListener()
- uncomment OnDocumentDoubleClick
-
Uncomment addHelpers() in populateScene()
PUSH TO GIT
-
Add controls
- Go to setupScene()
- Uncomment setupControls()
- Investigate setupControls()
-
Update overlayItem property
PUSH TO GIT
-
Investigate
-
Change the aesthetic
- Add Fog
- Go to populateScene()
- Uncomment setupFog()
- Change the colours in setupRenderer(), setupFog() and addLights()
PUSH TO GIT
- Add post processing
- Go to setupScene
- Uncomment setupPostProcessing() Investigate setupPostProcessing()
PUSH TO GIT
- Add Fog
-
Connect to Netlify to publish website.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration