threejs-geometry

Creates Three.js geometries including built-in shapes, BufferGeometry, and instanced meshes.

Updated May 5, 2026
One-click install
npx skills add https://github.com/josippapez/ai-setup --skill threejs-geometry-josippapez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-geometry
Source: https://github.com/josippapez/ai-setup/tree/main/claude/plugins/better-design/skills/threejs-geometry
Command: npx skills add https://github.com/josippapez/ai-setup --skill threejs-geometry-josippapez

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three.

What problem does it solve? Building 3D scenes in Three.js requires knowing dozens of geometry constructors, attribute layouts, and performance patterns, and mistakes in vertex data or segment counts cause rendering bugs or slow frame rates. ## Core Features & Use Cases - Built-in Shapes: Reference for Box, Sphere, Cylinder, Torus, Lathe, Extrude, Tube, and Text geometries with full parameter signatures. - Custom BufferGeometry: Patterns for defining positions, normals, UVs, colors, and indices as typed arrays, plus interleaved buffers for memory efficiency. - Instanced Rendering: InstancedMesh and InstancedBufferGeometry patterns for rendering thousands of copies with per-instance transforms and colors. - Use Case: When building a particle field or a crowd of repeated objects, use the InstancedMesh pattern to render 1000 boxes in a single draw call instead of creating 1000 separate meshes. ## Quick Start Create a Three.js scene with a custom BufferGeometry triangle mesh and an InstancedMesh of 500 randomly placed boxes.

Frequently Asked Questions about threejs-geometry

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

FAQPage Schema
How do I create custom geometry in Three.js?

Create a THREE.BufferGeometry and set attributes with typed arrays: position (3 floats per vertex), normal, uv, and optionally color. Add an index buffer with setIndex to reuse vertices across triangles, then call computeVertexNormals if lighting is needed.

How to render thousands of objects efficiently in Three.js?

Use THREE.InstancedMesh with a shared geometry and material, setting per-instance transforms via setMatrixAt and optional per-instance colors with setColorAt. This renders all copies in one draw call instead of one per mesh.

What is the difference between BufferGeometry and InstancedBufferGeometry?

BufferGeometry stores per-vertex attributes for a single mesh, while InstancedBufferGeometry adds per-instance attributes via InstancedBufferAttribute for custom shader data beyond transforms. Use InstancedMesh for standard cases and InstancedBufferGeometry when shaders need custom per-instance values.

Why is my Three.js mesh black or not lit correctly?

Missing or incorrect normals cause lighting failures since materials like MeshStandardMaterial require them. Call geometry.computeVertexNormals() after modifying positions, and verify the normal attribute exists with 3 floats per vertex.

When should I merge geometries in Three.js?

Merge static meshes with BufferGeometryUtils.mergeGeometries to reduce draw calls when objects share materials and never move independently. All merged geometries must have identical attribute sets, and you should dispose of unused source geometries afterward.