N.E.K.O: Skill for Claude Code

.agent/skills/3d-interaction/SKILL.md

3d-camera-interaction is a skill for Claude Code, Codex from Project-N-E-K-O/N.E.K.O. It costs 50 tokens per session (1,131 once invoked), scanned A, original, Apache-2.0.

A guide to implementing drag, zoom, and boundary limits for 3D models in Three.js, a JavaScript library for displaying 3D graphics in a web page.

In plain words
What is it for?
Use it when building 3D camera controls, especially to keep dragging aligned with the mouse, prevent enlarged models from moving out of view, and avoid jumps when dragging starts.
Why use it?
It explains why fixed movement speeds and center-point limits behave incorrectly after zooming, and shows how camera distance and the model's visible edges affect movement.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is Project-N-E-K-O/N.E.K.O's own configuration. It tells Claude Code and Codex how to work on N.E.K.O itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything N.E.K.O configures →

About the project

N.E.K.O is a real-time AI catgirl companion designed to live with the user, initiate interaction, share media, and perform tasks through an emotional engine. It is intended for people seeking a proactive personal digital companion. The catalogue contains skills for working with it.

Project-N-E-K-O/N.E.K.O · 2,790 stars · on GitHub · store.steampowered.com

Reuse

Borrowing it

Nothing to install: this file belongs to Project-N-E-K-O/N.E.K.O. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Project-N-E-K-O/N.E.K.O/main/.agent/skills/3d-interaction/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Project-N-E-K-O/N.E.K.O

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 3d-camera-interaction

README.md
[![agentmods](https://agentmods.dev/badge/skills/project-n-e-k-o/n.e.k.o/3d-interaction/github.svg)](https://agentmods.dev/skills/project-n-e-k-o/n.e.k.o/3d-interaction)
Your own site
<a href="https://agentmods.dev/skills/project-n-e-k-o/n.e.k.o/3d-interaction"><img src="https://agentmods.dev/badge/skills/project-n-e-k-o/n.e.k.o/3d-interaction/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 3d-camera-interaction

Your own site · 80×15
<a href="https://agentmods.dev/skills/project-n-e-k-o/n.e.k.o/3d-interaction"><img src="https://agentmods.dev/badge/skills/project-n-e-k-o/n.e.k.o/3d-interaction.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,131 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.01131
Opus 5 $0.00025 $0.00566
Sonnet 5 $0.00010 $0.00226
Haiku 4.5 $0.00005 $0.00113

Measured 9d ago against content hash ea74d9b5bb85, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

3d-camera-interaction scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agent/skills/3d-interaction/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

3D 相机交互:拖拽与边界检测

症状

  • 缩放后拖拽模型,鼠标移动 100px 但模型移动的屏幕距离不是 100px
  • 放大模型后只能看到腿/身体的一部分,无法正常平移
  • 拖动开始时模型位置"跳变"

根本原因

原因 1: 固定 panSpeed 导致移动不同步

问题: 使用固定的 panSpeed = 0.01 进行平移计算

// ❌ 错误方式
const panSpeed = 0.01;
newPosition.add(right.multiplyScalar(deltaX * panSpeed));

为什么发生: 相机距离变化时,同样的世界空间距离在屏幕上的像素表现不同。距离近时像素多,距离远时像素少。

解决方案: 根据相机距离和 FOV 动态计算像素→世界空间的映射

// ✅ 正确方式:动态计算
const cameraDistance = camera.position.distanceTo(modelCenter);
const fov = camera.fov * (Math.PI / 180);
const screenHeight = renderer.domElement.clientHeight;
const screenWidth = renderer.domElement.clientWidth;

// 在相机距离处,视口的世界空间高度
const worldHeight = 2 * Math.tan(fov / 2) * cameraDistance;
const worldWidth = worldHeight * (screenWidth / screenHeight);

// 每像素对应的世界空间距离
const pixelToWorldX = worldWidth / screenWidth;
const pixelToWorldY = worldHeight / screenHeight;

// 应用:鼠标移动的像素 × 每像素对应的世界空间距离
newPosition.add(right.multiplyScalar(deltaX * pixelToWorldX));
newPosition.add(up.multiplyScalar(-deltaY * pixelToWorldY));

原因 2: 基于中心点的边界限制

问题: 使用模型中心点的 NDC 坐标判断是否出界

// ❌ 错误方式:限制中心点位置
const ndc = position.clone().project(camera);
if (ndc.y > 0.2) clampedY = 0.2; // 限制顶部

为什么发生: 模型放大后,中心点在屏幕中心,但身体大部分已超出屏幕。限制中心点 = 限制只能看到身体中间部分。

解决方案: 计算模型在屏幕上的可见区域(像素),只在可见区域过小时才校正

// ✅ 正确方式:基于可见像素
const MIN_VISIBLE_PIXELS = 50;

// 1. 计算模型包围盒并投影到屏幕
const box = new THREE.Box3().setFromObject(vrm.scene);
const corners = [/* 8个顶点 */];

let modelMinX = Infinity, modelMaxX = -Infinity;
let modelMinY = Infinity, modelMaxY = -Infinity;

corners.forEach(corner => {
    const projected = corner.clone().project(camera);
    const screenX = (projected.x * 0.5 + 0.5) * screenWidth;
    const screenY = (-projected.y * 0.5 + 0.5) * screenHeight;
    // 更新边界...
});

// 2. 计算可见区域
const visibleWidth = Math.max(0, Math.min(screenWidth, modelMaxX) - Math.max(0, modelMinX));
const visibleHeight = Math.max(0, Math.min(screenHeight, modelMaxY) - Math.max(0, modelMinY));
const visiblePixels = visibleWidth * visibleHeight;

// 3. 只在可见区域太小时校正
if (visiblePixels < MIN_VISIBLE_PIXELS) {
    // 将模型拉回可见区域
}

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 111 lines · 50 tokens per session scan A ea74d9b5bb85

Subscribe to this mod's changes

3d-camera-interaction is a skill published in the GitHub repository Project-N-E-K-O/N.E.K.O (2,790 stars, last pushed yesterday), licensed Apache-2.0. It adds 50 tokens to every session and 1,131 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.