threejs-core-math

Perform vector, matrix, and quaternion math for Three.js projects.

11|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package --skill threejs-core-math
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-core-math
Source: https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package/tree/main/skills/source/threejs-core/threejs-core-math
Command: npx skills add https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package --skill threejs-core-math

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides comprehensive guidance for 3D math in Three.js, covering vectors, matrices, quaternions, Euler, Color, and related utilities to prevent mutating shared data and misapplied rotations.

Core Features & Use Cases

  • Vectors, Matrices, and Quaternions: detailed explanations and best practices for Vector3, Matrix4, Quaternion, Euler, and Color operations.
  • Coordinate Systems and Transformations: right-handed, Y-up conventions, and TRS decomposition/recomposition.
  • Common Pitfalls: gimbal lock, mutating shared objects, and incorrect unit conversions.
  • Use Case: building precise 3D math pipelines for scene setup, animation, and physics integration.

Quick Start

Read the guide and apply the examples to set up vector, matrix, and quaternion workflows in your Three.js project.

Frequently Asked Questions about threejs-core-math

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

FAQPage Schema
How do I correctly use Three.js Matrix4 for TRS transformations?

Three.js Matrix4 TRS transformations decompose and recompose translation, rotation, and scale using standard right-handed Y-up conventions. Apply matrix transforms sequentially to position objects precisely within your 3D scene without misaligning coordinate axes.

Why does my Three.js quaternion rotation cause gimbal lock?

Three.js quaternion rotation causes gimbal lock when you improperly chain Euler angles instead of using quaternion multiplication. Use Quaternion operations directly to bypass Euler angle sequencing limitations and maintain smooth 3D rotation interpolation.

What's the best way to prevent mutating shared Vector3 objects in Three.js?

Prevent mutating shared Vector3 objects in Three.js by cloning vectors before applying operations like add, multiply, or normalize. Enforce correct mutability practices by treating Vector3 methods as in-place operations and copying shared data first.

Can I use Three.js Color utilities for color space management across scenes?

Three.js Color utilities support color space management across common scenes by handling color conversions and ensuring consistent rendering. Use Color operations to manage gamma, linear, and sRGB spaces correctly within your 3D rendering pipeline.

When do I need Three.js Euler angles versus quaternions for 3D math?

Use Three.js Euler angles for simple, human-readable axis rotations and quaternions for complex 3D math requiring gimbal-lock-free rotation interpolation. Choose quaternions when chaining rotations or animating camera paths to avoid Euler angle limitations.