一键导入
threejs
Three.js 几何体:内置几何、BufferGeometry、自定义属性、Instancing。用户需要创建/优化网格几何时调用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Three.js 几何体:内置几何、BufferGeometry、自定义属性、Instancing。用户需要创建/优化网格几何时调用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Weekly Focus Engineering analysis using ActivityWatch data. Use when analyzing app usage patterns, detecting context switching problems, identifying "death loops" (repetitive app switching), calculating focus scores, or creating weekly productivity reviews.
WCAG 2.2 AA conformance auditor. Systematically verifies success criteria through automated, interactive, and manual testing methods.
Implement features from spec documents (context/doc required)
PR review for bugs, security & quality (requires PR URL)
Brutally honest roasts of your code with fixes
Accessibility improvement planning support. Generates organizational maturity assessment, phased roadmap, KPI design, and stakeholder persuasion materials.
| name | Three.js几何体 |
| description | Three.js 几何体:内置几何、BufferGeometry、自定义属性、Instancing。用户需要创建/优化网格几何时调用。 |
import * as THREE from "three";
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshStandardMaterial({ color: 0x4aa3ff });
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
BufferGeometrygeometry.attributes 中(如 position、normal、uv)position:每个顶点的 xyz(Float32BufferAttribute)normal:法线(影响光照)uv:纹理坐标index:索引(复用顶点)const positions = new Float32Array([
0, 0, 0,
1, 0, 0,
0, 1, 0,
]);
const geom = new THREE.BufferGeometry();
geom.setAttribute("position", new THREE.BufferAttribute(positions, 3));
geom.computeVertexNormals();
InstancedMesh 将大量相同几何+材质的对象合批渲染const count = 1000;
const g = new THREE.SphereGeometry(0.05, 16, 16);
const m = new THREE.MeshStandardMaterial({ color: 0xffffff });
const instanced = new THREE.InstancedMesh(g, m, count);
const mat4 = new THREE.Matrix4();
for (let i = 0; i < count; i++) {
mat4.makeTranslation(Math.random() * 10 - 5, Math.random() * 2, Math.random() * 10 - 5);
instanced.setMatrixAt(i, mat4);
}
instanced.instanceMatrix.needsUpdate = true;
scene.add(instanced);
needsUpdate = trueconst pos = geom.attributes.position;
pos.setXYZ(0, 0, 0, 0.2);
pos.needsUpdate = true;
geom.computeBoundingBox();
geom.computeBoundingSphere();
index 就用索引:减少顶点重复