
threejs-math
three.js math library: Vector2/3/4, Matrix3/4, Quaternion, Euler, Color, Box2/Box3, Sphere, Plane, Ray, Line3, Triangle, Frustum, Cylindrical/Spherical coords, MathUtils, and Interpolant base classes; addon math utilities such as OBB, Octree, Capsule, ConvexHull, MeshSurfaceSampler. Use for transforms, intersection tests, and spatial queries; for keyframe interpolation tied to AnimationMixer use threejs-animation; for picking implementation use threejs-objects with Raycaster.
- Installs
- 380
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-math- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads threejs-math automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
When to use this skill
ALWAYS use this skill when the user mentions:
- Vector/matrix math order,
applyQuaternion,lookAt, world vs local transforms - Bounding volumes
Box3/Sphere, containment/intersection tests RayvsPlanevsFrustumtests (without full picking pipeline)
IMPORTANT: math vs objects vs animation
| Need | Skill |
|---|---|
| Raw math types | threejs-math |
Raycaster + layers picking | threejs-objects |
| QuaternionKeyframeTrack playback | threejs-animation |
Trigger phrases include:
- "Vector3", "Matrix4", "Quaternion", "Box3", "Ray", "Frustum"
- "向量", "矩阵", "四元数", "包围盒"
How to use this skill
- Conventions: multiply vectors by matrices on the left as three.js examples show; call
updateMatrixWorldbefore world-space queries (threejs-objects). - Bounding:
Box3().setFromObject(object)for rough bounds; refine per need. - Collision-ish checks:
ray.intersectBox,sphere.containsPoint, etc., per docs. - Addon structures:
Octree/OBBfor games—cite addon pages, avoid copying full API tables here. - Color:
Colorconversions relate to materials/textures—cross-link. - Random sampling:
MeshSurfaceSamplerfor distributing points on meshes.
See examples/workflow-ray-aabb.md.
Doc map (official)
| Docs section | Representative links |
|---|---|
| Math | https://threejs.org/docs/Vector3.html |
| Math | https://threejs.org/docs/Matrix4.html |
| Math | https://threejs.org/docs/Quaternion.html |
| Math | https://threejs.org/docs/Ray.html |
Scope
- In scope: Core Math types; addon math entries as pointers.
- Out of scope: Keyframe track evaluation beyond type references (animation skill).
Common pitfalls and best practices
- Euler gimbal lock—prefer quaternions for arbitrary rotations.
- Reusing temporary vectors reduces GC thrash in hot loops.
- Frustum culling helpers vary—verify against your three version.
Documentation and version
Core math types are listed under Math; addon utilities (Octree, OBB, …) appear under Addons → Math in three.js docs. Global also lists constants (e.g. wrapping, blending) sometimes needed alongside materials.
Agent response checklist
When answering under this skill, prefer responses that:
- Link the concrete type (
Vector3,Matrix4,Quaternion, …) from the docs. - Send
AnimationMixer/ track math to threejs-animation when time-sampled. - Send
Raycasterpicking flows to threejs-objects when interaction is the goal. - Mention numeric stability (epsilon) where comparisons matter.
- Point to Addons → Math for game-oriented structures when users need spatial acceleration.
References
- https://threejs.org/docs/#Math
- https://threejs.org/docs/MathUtils.html
- https://threejs.org/docs/Ray.html
Keywords
English: vector, matrix, quaternion, euler, box3, sphere, ray, frustum, three.js
中文: 向量、矩阵、四元数、欧拉角、包围盒、射线、three.js
FAQ
What does the threejs-math skill do?
three.js math library: Vector2/3/4, Matrix3/4, Quaternion, Euler, Color, Box2/Box3, Sphere, Plane, Ray, Line3, Triangle, Frustum, Cylindrical/Spherical coords, MathUtils, and Interpolant base classes; addon math utilities such as OBB, Octree, Capsule, ConvexHull, MeshSurfaceSampler. Use for transforms, intersection tests, and spatial queries; for keyframe interpolation tied to AnimationMixer use threejs-animation; for picking implementation use threejs-objects with Raycaster.
How do I install threejs-math?
Run npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-math in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/threejs-math/ (personal) or .claude/skills/threejs-math/ (project).
Which AI agents can use threejs-math?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is threejs-math safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains threejs-math?
It is published by full-stack-skills in full-stack-skills/threejs-skills. It has 380 recorded installs.
More from full-stack-skills/threejs-skills
threejs-postprocessing
full-stack-skills/threejs-skills
Addon screen-space post-processing for three.js using EffectComposer, Pass base class, RenderPass, and stock passes such as UnrealBloomPass, SSAOPass, SSRPass, BokehPass, OutlinePass, FXAAPass/SMAAPass, TAARenderPass, and ShaderPass; references the Shaders addon group for underlying shader modules; contrasts with core PostProcessing class used in node/WebGPU stacks (see threejs-node-tsl and threejs-renderers). Use when building composer chains—not for basic renderer tone mapping alone (threejs-renderers).
threejs-objects
full-stack-skills/threejs-skills
three.js scene graph objects: Object3D transforms and hierarchy, Group, Mesh, InstancedMesh, SkinnedMesh, BatchedMesh, LOD, Line/LineLoop/LineSegments, Points, Sprite, Bone, Skeleton, ClippingGroup; interaction via Raycaster, Layers masks, and EventDispatcher patterns. Merges the former interaction scope—use for picking and layers; for pure vector math without scene graph use threejs-math; for playing skeletal clips use threejs-animation; for frustum culling internals see camera docs.
threejs-materials
full-stack-skills/threejs-skills
Open the skill to read its SKILL.md instructions.
threejs-animation
full-stack-skills/threejs-skills
Open the skill to read its SKILL.md instructions.
threejs-renderers
full-stack-skills/threejs-skills
Open the skill to read its SKILL.md instructions.
threejs-dev-setup
full-stack-skills/threejs-skills
Bootstrap and toolchain guidance for three.js applications using npm, Vite/Webpack/Rollup, bare ESM import maps, and TypeScript. Covers canonical import paths for three core versus three/addons/ (examples/jsm re-exports), version alignment with https://threejs.org/docs/, and fixing "module not found" for loaders and controls. Use when scaffolding a new 3D project, migrating bundler, or debugging resolution of addons—do not use for rendering API details (see threejs-renderers) or asset loading logic (see threejs-loaders).
Popular education & science skills
teach
mattpocock/skills
Teach the user a new skill or concept, within this workspace.
scaffold-exercises
mattpocock/skills
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
paper-context-resolver
lllllllama/rigorpilot-skills
Rigor Paper Context helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacing README guidance by default.
caveman-learn
juliusbrussee/caveman
Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.
gsap-plugins
greensock/gsap-skills
Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.
teach-impeccable
pbakaus/impeccable
DEPRECATED: Use /impeccable teach instead. This command has been folded into the impeccable skill.