Gojiberry AI
AI agents that find and contact high-intent leads for you
Try Gojiberry free →
Hermes Agent
Run your Hermes agent, fully managed
Launch on Hostinger →
Hostinger VPS
Spin up a VPS in one click, 20% off
Launch on Hostinger →
Firecrawl
Crawl and scrape any site into clean data
Try Firecrawl free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
Context.dev
One API to scrape, enrich, and extract the web
Start building free →
Jotform
Forms, workflows, and AI Agents for your team
Try Jotform free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
OpenClaw
Deploy a managed OpenClaw agent in 60 seconds
Launch on Hostinger →
Sponsor here
9/10 sponsor slots taken — 1 left
Claim it →
Claude Market
Menu
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Claude Market
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-scene-setup
threejs-scene-setup logo

threejs-scene-setup

gamedev-skills/awesome-gamedev-agent-skills
843 installs462 stars
Run it on Hostinger, 20% off →Your friend gets 20% off too, using this linkFree API →|External Downloads|View on GitHub|Create your own skill →

Installation

npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill threejs-scene-setup

Summary

>

SKILL.md

three.js Scene Setup

Create the foundation of a three.js app: module loading, the scene/camera/renderer trio, the render loop, responsive resizing, and camera controls. Patterns target r184. Read the installed three version before changing an existing project because examples and addons move across releases.

When to use

  • Use when bootstrapping a three.js scene, fixing a blank/black canvas, making the

canvas responsive, setting up the animation loop, or adding OrbitControls.

  • Use when package.json depends on three and code does `import * as THREE from

'three'`.

*When not to use:* loading .gltf/.glb models or skinned animation → threejs-gltf-loading. Materials, lights, shadows, environment maps → threejs-materials-lighting. 2D rendering → pixijs-rendering.

Core workflow

  1. Load three.js as an ES module with an import map. Since r147 the bare

specifier 'three' and 'three/addons/' must be mapped (in HTML or by a bundler). Addons (controls, loaders) live under three/addons/....

  1. Create the trio. A Scene (root of the graph), a `PerspectiveCamera(fov,

aspect, near, far) moved back from the origin, and a WebGLRenderer whose domElement is in the DOM. Set size and pixelRatio`.

  1. Add a mesh. new Mesh(geometry, material) and scene.add(mesh). With a

lit material you also need a light (see threejs-materials-lighting).

  1. Drive a render loop with renderer.setAnimationLoop(fn). It's the modern,

WebXR-/WebGPU-safe replacement for hand-rolled requestAnimationFrame. Use a Clock for delta time.

  1. Handle resize so the camera aspect and renderer match the canvas; update

camera.aspect, call updateProjectionMatrix(), and renderer.setSize(...).

  1. Add OrbitControls for orbit/pan/zoom while developing. Confirm something

actually renders (a lit cube, the controls responding) before assuming success.

Patterns

1. HTML import map + module entry (no bundler)

<canvas id="c"></canvas>
<script type="importmap">
{
  "imports": {
    "three": "https://cdn.jsdelivr.net/npm/three@0.184.0/build/three.module.js",
    "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.184.0/examples/jsm/"
  }
}
</script>
<script type="module" src="./main.js"></script>

With a bundler (Vite/webpack), skip the import map and just npm i three; the same import statements resolve.

2. Scene + camera + renderer

// main.js
import * as THREE from 'three';

const canvas = document.querySelector('#c');
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); // cap for perf
renderer.setSize(window.innerWidth, window.innerHeight);

const scene = new THREE.Scene();
scene.background = new THREE.Color(0x101018);

const camera = new THREE.PerspectiveCamera(
  60,                                   // vertical field of view (degrees)
  window.innerWidth / window.innerHeight, // aspect
  0.1,                                  // near
  100                                   // far
);
camera.position.set(3, 2, 5);
camera.lookAt(0, 0, 0);

const cube = new THREE.Mesh(
  new THREE.BoxGeometry(1, 1, 1),
  new THREE.MeshNormalMaterial()        // unlit; shows orientation without a light
);
scene.add(cube);

3. The render loop (setAnimationLoop + Clock)

const clock = new THREE.Clock();

renderer.setAnimationLoop(() => {
  const dt = clock.getDelta();          // seconds since last frame
  cube.rotation.x += dt;                // frame-rate independent
  cube.rotation.y += dt * 0.7;
  renderer.render(scene, camera);
});
// renderer.setAnimationLoop(null); // stop the loop

4. Responsive resize

function onResize() {
  const w = window.innerWidth, h = window.innerHeight;
  camera.aspect = w / h;
  camera.updateProjectionMatrix();      // required after changing aspect
  renderer.setSize(w, h);
}
window.addEventListener('resize', onResize);

5. OrbitControls (orbit / pan / zoom)

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;          // inertial feel
controls.target.set(0, 0, 0);

renderer.setAnimationLoop(() => {
  controls.update();                    // needed every frame when damping is on
  renderer.render(scene, camera);
});

Pitfalls

  • Failed to resolve module specifier "three" → missing import map (or bundler

config). Map both "three" and "three/addons/"; addon paths must end with /.

  • Black canvas, no errors → camera is at the origin (inside/behind the object),

or you used a lit material (MeshStandardMaterial) with no light. Move the camera back; use MeshNormalMaterial/MeshBasicMaterial to verify geometry first.

  • Nothing animates → you never called renderer.render inside the loop, or you

call setAnimationLoop but render outside it.

  • Stretched / squashed view on resize → you resized the renderer but didn't

update camera.aspect + updateProjectionMatrix().

  • Blurry or jagged on HiDPI → set renderer.setPixelRatio(...); cap it (≈2) so

4K/retina screens don't tank performance.

  • OrbitControls feel dead → with enableDamping = true you must call

controls.update() every frame.

  • Old tutorials use <script src="three.min.js"> → since r147 three.js ships

ES modules only; use type="module" + import maps.

References

  • For coordinate conventions, the scene-graph (Group, parent/child transforms,

Object3D add/remove), OrthographicCamera for 2.5D, and disposing of geometries/materials/textures to avoid leaks, read references/scene-graph.md.

Related skills

  • threejs-materials-lighting — give surfaces a lit look (lights, shadows, PBR).
  • threejs-gltf-loading — load 3D models and play their animations.
  • pixijs-rendering — 2D rendering in the browser.
  • fps-shooter — a 3D genre template that composes three.js skills.

Score

0–100
55/ 100

Grade

C

Popularity15/30

843 installs — growing adoption.

Completeness19/30

Documented: full SKILL.md body, one-line install. Missing: description, category/license metadata.

Trust15/25

Community skill with a public GitHub source repository you can review.

Freshness6/15

No update timestamp is tracked for this skill in our catalog.

Scored automatically from popularity, completeness, trust, and freshness — computed only from data in our catalog, never fabricated.

Proud of your score? Add this badge to your README.

Paste a snippet into your GitHub README. The badge updates automatically and links back to this page.

Threejs Scene Setup skill score badge previewScore badge

Markdown

[![Threejs Scene Setup skill](https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-scene-setup/badges/score.svg)](https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-scene-setup)

HTML

<a href="https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-scene-setup"><img src="https://www.claudemarket.ai/skills/gamedev-skills/awesome-gamedev-agent-skills/threejs-scene-setup/badges/score.svg" alt="Threejs Scene Setup skill"/></a>

Threejs Scene Setup FAQ

How do I install the Threejs Scene Setup skill?

Run “npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill threejs-scene-setup” in your terminal. The skill is added to your agent's skills directory and picked up automatically on the next run — no restart or extra configuration needed.

What does the Threejs Scene Setup skill do?

> The full SKILL.md on this page shows the exact instructions the skill gives your agent.

Is the Threejs Scene Setup skill free?

Yes. Threejs Scene Setup is a free, open-source skill published from gamedev-skills/awesome-gamedev-agent-skills. As with any third-party skill, review the source repository before installing it into an agent with sensitive access.

Does Threejs Scene Setup work with Claude Code and OpenClaw?

Yes. Skills use the portable SKILL.md format, so Threejs Scene Setup works with Claude Code, OpenClaw, Codex, Hermes, and any other agent that reads SKILL.md skills.

Recommended skills

Browse all →
setup-matt-pocock-skills logo

setup-matt-pocock-skills

mattpocock/skills

596K installsInstall
airunway-aks-setup logo

airunway-aks-setup

microsoft/azure-skills

261K installsInstall
setup-pre-commit logo

setup-pre-commit

mattpocock/skills

208K installsInstall
prisma-database-setup logo

prisma-database-setup

prisma/skills

152K installsInstall
prisma-postgres-setup logo

prisma-postgres-setup

prisma/skills

140K installsInstall
convex-setup-auth logo

convex-setup-auth

get-convex/agent-skills

94K installsInstall

Related guides

Hand-picked reading to help you choose, install, and use agent skills.

GuideBest Openclaw Skills 2026GuideHow To Evaluate Openclaw Skill Before InstallingGuideOpenclaw Skills Complete Guide

Skills by category

FrontendBackend & APIsTesting & QASecurityDevOps & CI/CDMCP & ToolingAutomationData & Analysis+27 more

MCP servers by category

MCP & ToolingBackend & APIsData & AnalysisDevOps & CI/CDAutomationSecurityDocsTesting & QA+24 more

Plugins by category

AutomationDevOps & CI/CDData & AnalysisDesign & CreativeSecurityBackend & APIsFrontendTesting & QA+16 more

Marketplaces by category

AutomationData & AnalysisDevOps & CI/CDDesign & CreativeFrontendBackend & APIsTesting & QASecurity+21 more

The Agent Stack

Weekly Claude Code, Agent SDK, and MCP moves worth your time — free.

Claude Market

AI agent skills directory, marketplace, and workflow hub for OpenClaw, Hermes Agent, Claude Code, Codex, and MCP-powered operator stacks.

Independent project, not affiliated with Anthropic.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Plugins
  • Browse Marketplaces
  • Newsletter

More

  • Submit a Tool
  • Create a Skill
  • Advertise
  • Free Tools
  • API
  • Shipping
  • Contact
  • Terms
  • Privacy
© 2026 Claude Market · Not affiliated with Anthropic
Fazier badgeFeatured on Twelve ToolsFeatured on Wired BusinessRemote OpenClaw - Featured on AI Agents DirectoryListed on Turbo0Featured on Uneed