
Threejs Fundamentals
This covers the core Three.js classes you'll reach for in every project: scene setup, perspective and orthographic cameras, renderer configuration, and the Object3D hierarchy that everything inherits from. The examples show practical patterns like proper resize handling, pixel ratio capping, and the difference between local and world transforms. It's especially useful if you keep forgetting whether to call updateProjectionMatrix after changing camera properties or how to properly compose transformation matrices. The coordinate system reminder and math utilities section (Vector3, Matrix4, Quaternion) are handy references when you're deep in transform calculations. Solid foundation material that assumes you already know why you need Three.js.
- skills.sh installs
- 21.7K
- GitHub stars
- 4.1K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add cloudai-x/threejs-skills --skill threejs-fundamentals --agent claude-codeInstalls into .claude/skills of the current project.
Files
Three.js Fundamentals
Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.
Quick Start
import * as THREE from "three";
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x111318);
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0, 1.5, 5);
const cube = new THREE.Mesh(
new THREE.BoxGeometry(1, 1, 1),
new THREE.MeshStandardMaterial({ color: 0x3a86ff }),
);
scene.add(cube);
const light = new THREE.DirectionalLight(0xffffff, 2);
light.position.set(3, 4, 5); // shines from its position toward the origin
scene.add(light);
scene.add(new THREE.AmbientLight(0xffffff, 0.4));
const timer = new THREE.Timer();
timer.connect(document); // freezes the delta while the tab is hidden
Sponsors
Details
- Repository
- github.com/cloudai-x/threejs-skills