Skip to main content
skill CX Codex

threejs-scene · cesartevisual — Claude Code skill: what it does, how to install

This skill for Claude Code configures Three.js scene hierarchies, camera framing, coordinate transforms, and renderer lifecycles. It enforces proper GPU cleanup and bounds calculations.

MIT 671 installs ★ 26 updated 2026-09-10

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add cesartevisual/threejs-skills --skill threejs-scene -a claude-code
Open on GitHub

What threejs-scene does

Sets up Three.js scenes, coordinate systems, and render loops according to engine best practices. It isolates imported model transforms inside interaction groups, relies on quaternion interpolation, and updates world matrices before running synchronous bounding checks.

For camera framing, it fits perspective viewports against both horizontal and vertical fields of view so wide models do not get cut off. Canvas sizing tracks the parent element through ResizeObserver while keeping CSS layout values separate from drawing buffer dimensions.

Disposing of the renderer alone leaves scene assets in GPU memory. The instructions enforce stopping animation loops, disconnecting resize observers, and explicitly releasing textures, geometries, and materials during teardown.

What it helps with

  • fit perspective camera bounds across horizontal and vertical axes
  • isolate model pivot transforms using Three.js groups
  • handle canvas resizing with ResizeObserver without altering CSS
  • clean up GPU resources and stop render loops on unmount

Example prompts for the agent

  • Frame the perspective camera to fit this wide 3D model without clipping the edges.
  • Convert these Euler rotations to quaternion interpolation and reuse vectors in the render loop.
  • Implement a teardown routine that stops the render loop and releases all Three.js GPU resources.

How to install threejs-scene

1Skills CLI (Vercel)

npx skills add cesartevisual/threejs-skills --skill threejs-scene -a claude-code

2Manually: put the files in place

~/.claude/skills/threejs-scene/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/threejs-scene/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about threejs-scene

How to install threejs-scene in Claude Code?

Run npx skills add cesartevisual/threejs-skills --skill threejs-scene -a claude-code. Alternatively, place the file directly at ~/.claude/skills/threejs-scene/SKILL.md.

What does threejs-scene do?

It guides coding agents on Three.js scene architecture, matrix transformations, camera FOV calculations, and responsive canvas sizing.

Does disposing the renderer clean up the entire scene?

Calling dispose on the renderer does not free scene geometries or textures. You must explicitly dispose of scene resources, remove listeners, and stop the animation loop.

Source text

SKILL.md · MIT
---
name: threejs-scene
description: "Build or correct Three.js scene hierarchies, camera framing, coordinate transforms, and responsive renderer lifecycles."
---

# Scenes, Cameras, and Math

Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions.

Inspect the host element size, renderer ownership, world scale, handedness, up axis, and camera type before changing the scene. Prefer a single renderer for one experience; use viewports/scissors when multiple views genuinely benefit from shared resources.

Separate imported model transforms from interaction pivots using groups. Distinguish local and world coordinates; update world matrices before synchronous bounds or coordinate queries when transforms just changed. Use quaternion interpolation for orientations and reusable vectors in hot paths. Avoid repeatedly converting between Euler angles and quaternions.

Fit a perspective camera against object bounds and both horizontal and vertical field of view; fitting only height can crop a wide subject. Choose a positive near plane and useful far plane for perspective depth precision. Orthographic cameras may use a zero near plane. Update the projection matrix after projection changes.

Size from the canvas container with ResizeObserver, skip zero dimensions, and keep CSS size separate from drawing-buffer size. Apply a deliberate pixel-ratio budget. Update camera, renderer, and size-dependent render targets together. Do not overwrite layout CSS with renderer sizing.

Use one render-loop owner. setAnimationLoop integrates with XR; an existing framework or requestAnimationFrame loop can be valid outside XR. Stop the loop, disconnect observers, remove listeners, and release owned GPU resources on teardown. Renderer disposal alone does not dispose scene resources.

Verify a non-square container, mobile orientation, hidden-to-visible transitions, repeated mounting, and framing of unusually wide or tall assets.

## API reference

Consult the [official documentation](https://threejs.org/docs/pages/PerspectiveCamera.html) for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.

© cesartevisual · MIT · cesartevisual/threejs-skills

Similar skills

All skills for Frontend and UI →

threejs-scene by other authors comes first.

threejs-scene exploraX This Claude Code skill builds interactive three.js scenes from code, without model files. It activates for 3D websites, WebGL hero sections and real-world objects rendered in 3D. CX Codex +1 ★ 448repo stars threejs-scene-setup gamedev-skills threejs-scene-setup — a skill for Claude Code sets up a basic three.js r187 scene, camera, renderer, and animation loop. Runs on import errors, blank canvases, or static frames. CX Codex +1 11,100installs threejs-scene-builder Prompt-or-Die-Labs threejs-scene-builder — a skill for building 3D scenes with Three.js and React Three Fiber: from basic setup to procedural generation and animation retargeting. CX Codex +1 2installs threejs-performance CloudAI-X threejs-performance — a skill for Claude Code, Codex, Cursor and other platforms measures three.js rendering speed and optimizes scenes. Runs when a scene lags or hits memory limits. CX Codex +1 7,100installs threejs-interaction calesthio threejs-interaction is a Claude Code skill for adding object picking, input handling, and camera controls to Three.js scenes. It comes into play when a project needs raycasting or interactive 3D behavior. CX Codex +1 1,200installs threejs-scene-composition calesthio threejs-scene-composition is a Claude Code skill for assembling and animating Three.js scenes for rendered media. It covers 3D product shots, title sequences, procedural worlds, and render QA. CX Codex +1 169installs threejs-materials CloudAI-X Skill for Claude Code, Codex, Cursor and other platforms: choosing and configuring three.js materials — from basic to PBR, toon shading and point clouds. Runs when you need to style a mesh, tune blending or switch to WebGPU. CX Codex +1 21,100installs

From the same set24

The whole set →
threejs-shaders threejs-shaders — a Claude Code skill for writing and debugging Three.js GLSL shaders, custom material effects, uniforms, and geometry deformation. CX Codex +1 694installs threejs-testing threejs-testing — a skill for Claude Code defines visual QA and browser testing guidelines for Three.js scenes. Focuses on deterministic fixtures, GPU checks, and teardown lifecycle tests. CX Codex +1 681installs threejs-interaction This Claude Code skill guides Three.js interaction work, from object picking to orbit controls. It applies when an agent is asked to add dragging, selection, or synchronized HTML controls. CX Codex +1 681installs threejs-assets The threejs-assets Claude Code skill guides loading and managing glTF models, textures, and user-provided 3D files. It applies to asset validation, compression, caching, and cleanup in Three.js projects. CX Codex +1 676installs threejs-materials The threejs-materials Claude Code skill configures Three.js PBR materials, textures, transparency, and color handling. It activates when a scene needs a surface setup or a material-related color fix. CX Codex +1 668installs threejs-debugging The threejs-debugging Claude Code skill traces rendering faults in Three.js scenes. It kicks in for blank canvases, missing meshes, color issues, flicker, picking failures, or lost graphics context. CX Codex +1 658installs threejs-postprocessing This Claude Code skill adds or debugs Three.js postprocessing. It handles tasks involving bloom, antialiasing, ambient occlusion, depth effects, and render-target composition. CX Codex +1 651installs threejs-particles Claude Code skill for building Three.js particle systems, point clouds, and GPU simulations. CX Codex +1 648installs

Project sponsors

Companies that keep this analytics open