threejs-fundamentals

Automate Three.js scene setup with cameras, renderer, and object hierarchies.

1|Updated Apr 7, 2025
One-click install
npx skills add https://github.com/mmdonohue/zuzu --skill threejs-fundamentals-mmdonohue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-fundamentals
Source: https://github.com/mmdonohue/zuzu/tree/main/.claude/skills/threejs-fundamentals
Command: npx skills add https://github.com/mmdonohue/zuzu --skill threejs-fundamentals-mmdonohue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a clear, repeatable approach to setting up Three.js scenes, including scene creation, camera configuration, renderer setup, and basic object hierarchies.

Core Features & Use Cases

  • Scene & Camera Setup: Quickly initialize a scene, perspective/orthographic cameras, and a WebGL renderer.
  • Object Hierarchy & Transforms: Manage Object3D hierarchies, local/global transforms, and coordinate systems for consistent animation.
  • Practical Examples: Build interactive 3D demos, such as rotating cubes, lighting, and responsive rendering.

Quick Start

Copy the following basic Three.js setup to create a scene with a rotating cube: import * as THREE from 'three'; const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); const cube = new THREE.Mesh(geometry, material); scene.add(cube); camera.position.z = 5; function animate() { requestAnimationFrame(animate); cube.rotation.x += 0.01; cube.rotation.y += 0.01; renderer.render(scene, camera); } animate();

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 with a camera and renderer?

Setting up a Three.js scene requires initializing a Scene, configuring a PerspectiveCamera, and creating a WebGLRenderer to display your 3D objects. This provides a clear, repeatable approach to scene creation, camera configuration, and renderer setup.

What is the best way to manage Object3D hierarchies and transforms in Three.js?

Managing Object3D hierarchies in Three.js involves organizing local and global transforms within coordinate systems. This approach ensures consistent animation by properly managing parent-child relationships and spatial transformations across your 3D scene.

Do I need a modern browser environment to run Three.js and WebGL rendering?

Yes, running Three.js and WebGL rendering requires a modern browser environment to execute. You also need the Three.js library included in your project to properly initialize the renderer and display interactive 3D experiences.

How do I create a rotating cube in Three.js with basic lighting?

Creating a rotating cube in Three.js involves defining a BoxGeometry, applying a MeshBasicMaterial, and updating the rotation values inside an animation loop. This practical example demonstrates scene graphs, transforms, and lighting for interactive 3D demos.

How does a Three.js scene graph handle coordinate systems for 3D objects?

A Three.js scene graph handles coordinate systems by structuring Object3D hierarchies that manage local and global transforms. This structure allows developers to position, rotate, and scale 3D objects consistently within the WebGL renderer.

Can I use Three.js for building interactive 3D tutorials and learning materials?

Yes, you can use Three.js for building interactive 3D tutorials, learning materials, and responsive rendering demos. It provides example code and patterns for common tasks like scene setup, camera configuration, and object hierarchies.