➡️ Documentation ⬅️
(You can clone your new repository with git clone <name-of-your-repository>
in your Terminal)
npm start
or
ng serve
By default, you can access it through: http://localhost:4200/
npm run build
or
ng build
A dist
folder is generated that can be statically hosted.
By default, you can add #debug
in the URL to access the debug panel, useful to tweak your scene.
Be sure to give a reload if you cannot see it.
Huge thanks to Bruno Simon for all the inspiration and the lessons he provides kindly.
This project is highly inspired by the Threejs Journey (Highly recommend it by the way).
I reworked the whole thing, so that it would fit in an Angular 14 project, with Typescript, obviously.
You don't need to use the "THREE" namespace in the project as usual. You can simply put the name of the type you want to use and put the right import.
import * as THREE from 'three';
const geometry = new THREE.BoxBufferGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
const mesh = new THREE.Mesh(geometry, material);
//...
becomes
import { BoxBufferGeometry, MeshBasicMaterial, Mesh } from 'three';
const geometry = new BoxBufferGeometry(1, 1, 1);
const material = new MeshBasicMaterial({ color: 0xff0000 });
const mesh = new Mesh(geometry, material);
//...
It's, in my opinion, a more angular-friendly way of writing our code.
You can reach me on Twitter: