threejs-fundamentals

Configures Three.js scenes, cameras, renderers, and Object3D hierarchies for 3D web applications.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/divinaarmuela/Content --skill threejs-fundamentals-divinaarmuela
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-fundamentals
Source: https://github.com/divinaarmuela/Content/tree/main/.claude/skills/threejs-fundamentals
Command: npx skills add https://github.com/divinaarmuela/Content --skill threejs-fundamentals-divinaarmuela

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three.

What problem does it solve? Setting up a Three.js scene involves many interdependent pieces—cameras, renderers, lights, object hierarchies, and math utilities—and getting any of them wrong leads to blank screens, distorted views, or memory leaks. This Skill provides correct, ready-to-use patterns for the core Three.js building blocks. ## Core Features & Use Cases - Scene and Renderer Setup: Configure WebGLRenderer with tone mapping, color space, shadows, and pixel ratio, plus scene backgrounds, fog, and environment maps. - Camera Configuration: Create Perspective, Orthographic, Array, and Cube cameras with correct projection settings and resize handling. - Object Hierarchy and Math: Manage Object3D transforms, groups, layers, and use Vector3, Matrix4, Quaternion, Euler, and Color utilities. - Use Case: You are building an interactive 3D product viewer and need a scene with a perspective camera, shadow-enabled renderer, rotating mesh, and responsive canvas that survives window resizes without leaking GPU memory. ## Quick Start Set up a basic Three.js scene with a perspective camera, a lit rotating cube, shadow-enabled renderer, and responsive resize handling.

Frequently Asked Questions about threejs-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a basic Three.js scene?

Create a THREE.Scene, a PerspectiveCamera with fov, aspect, near, and far values, and a WebGLRenderer with antialias enabled. Add meshes and lights to the scene, then call renderer.render inside a requestAnimationFrame loop.

What is the difference between PerspectiveCamera and OrthographicCamera in Three.js?

PerspectiveCamera simulates human-eye depth with a field of view, making distant objects smaller. OrthographicCamera has no perspective distortion and uses a fixed frustum, making it suitable for 2D, isometric, or CAD-style views.

How do I handle window resize in Three.js?

Update camera.aspect with the new width-to-height ratio, call camera.updateProjectionMatrix(), then call renderer.setSize with the new dimensions. Also reset the pixel ratio with Math.min(window.devicePixelRatio, 2) for sharp rendering.

Why does my Three.js app leak memory over time?

Geometries, materials, and textures hold GPU resources that are not freed automatically. Call dispose() on each geometry, material, and texture, remove objects from the scene, and call renderer.dispose() when tearing down.

How do I enable shadows in Three.js?

Set renderer.shadowMap.enabled to true and optionally choose THREE.PCFSoftShadowMap for softer edges. Then set castShadow on meshes that cast shadows and receiveShadow on meshes that receive them, and configure the light's shadow properties.