Three.js-Kamera und Auswahl
Wählt das Objekt aus, auf das der Spieler tatsächlich zeigt. Berücksichtigt Kamera, Canvas-Position und überlagerte Menüs und verbindet sichtbare Objekte mit stabilen Spielkennungen.
threejs-camera-picking
Entdecke, wie der Skill hilftWann ist der Skill hilfreich?
Nutze dies bei falschen Treffern in eingebetteten 3D-Szenen.
Wobei hilft er dir?
- Wandelt canvasrelative Zeigerwerte in normalisierte Gerätekoordinaten um.
- Begrenzt Raycast-Kandidaten und ordnet stabile Objektkennungen zu.
- Klärt UI-Eingabeübernahme vor Spielaktionen.
Das könntest du fragen
Wähle in unserem 3D-Strategiespiel eine Einheit neben der Minikarte aus. Prüfe Fenstergrößenänderung, Seitenscrollen und Kamerazoom. Die Einheit unter dem Zeiger wird gewählt, Dekoration fängt nichts ab und ein Minikarten-Klick wählt dahinter keine Einheit aus.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Three.js — camera picking
Use when implementing Three.js cameras, raycasting, pointer lock, selection or world-space UI.
Version and project gate
Inspect Three.js revision, renderer/backend, addons import style, bundler, color-management conventions, animation loop owner, scene scale, glTF/decoder versions and existing physics wrapper. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Define camera projection, world scale and input action ownership. Convert pointer coordinates from the canvas bounding rectangle into normalized device coordinates. Limit raycast candidates and map render objects to stable game identifiers. Resolve UI capture before gameplay input.
Deliver
A coordinate-space diagram and working select/move/interact behavior under resize and canvas offsets. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
Using the window size for an embedded canvas creates offset picking; smooth camera visuals must not change simulation authority.
Acceptance scenario
Pick the same object before and after resize, CSS layout shifts, device-pixel-ratio changes and overlapping UI. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Vex. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
Enthaltene Dateien 1
SKILL.md
