一键导入
threejs
Three.js 交互:Raycaster、鼠标/触摸输入、对象拾取、高亮与控制器集成。用户需要点击/拖拽/选择等交互时调用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Three.js 交互:Raycaster、鼠标/触摸输入、对象拾取、高亮与控制器集成。用户需要点击/拖拽/选择等交互时调用。
用 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 交互:Raycaster、鼠标/触摸输入、对象拾取、高亮与控制器集成。用户需要点击/拖拽/选择等交互时调用。 |
import * as THREE from "three";
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function onPointerMove(e) {
pointer.x = (e.clientX / window.innerWidth) * 2 - 1;
pointer.y = -(e.clientY / window.innerHeight) * 2 + 1;
}
window.addEventListener("pointermove", onPointerMove);
function animate() {
requestAnimationFrame(animate);
raycaster.setFromCamera(pointer, camera);
const hits = raycaster.intersectObjects(scene.children, true);
if (hits.length > 0) {
const hit = hits[0].object;
// 在这里做高亮/提示等交互反馈
}
renderer.render(scene, camera);
}
animate();
setFromCamera(ndc, camera):将屏幕坐标(NDC)投射到 3D 射线intersectObjects(objs, recursive):返回相交信息(距离、uv、face 等)pickables 数组,避免每次对整个场景树检测const pickables = [meshA, meshB];
const hits = raycaster.intersectObjects(pickables, true);