Toolverse
All skills

threejs-interaction

by CloudAI-X

Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
CloudAI-X
Category
Frontend
Views
2

About this skill

Three.js interaction - raycasting, controls, mouse/touch input, object selection. Use when handling user input, implementing click detection, adding camera controls, or creating interactive 3D experiences.

How to use

  1. Zaimportuj Three.js oraz OrbitControls z biblioteki three/addons. Utwórz instancję OrbitControls, przekazując kamerę i element renderera — włącz damping dla płynnego ruchu. 2. Zainicjuj Raycaster i Vector2 do przechowywania pozycji myszy. Dodaj nasłuchiwacz zdarzenia click, który konwertuje współrzędne pikseli na znormalizowane współrzędne NDC (od -1 do 1). 3. W funkcji obsługi kliknięcia ustaw promień raycaster'a od kamery poprzez pozycję myszy, używając setFromCamera(). 4. Wywołaj intersectObjects() na scenie, aby uzyskać tablicę wszystkich obiektów, które promień przecina. Tablica zawiera informacje o odległości, punkcie przecięcia, normalnej powierzchni i samym obiekcie. 5. Sprawdź, czy tablica intersects ma elementy — pierwszy element (indeks 0) to najbliższy obiekt. Możesz teraz reagować na kliknięcie, zmieniając właściwości obiektu, emitując zdarzenie lub uruchamiając akcję. 6. Opcjonalnie obsługuj wejście dotykowe, mapując współrzędne dotyku na ten sam system konwersji współrzędnych co mysz.

Related skills

interactive-dashboard-builder

by anthropics

Build self-contained interactive HTML dashboards with Chart.js, dropdown filters, and professional styling. Use when creating dashboards, building interactive reports, or generating shareable HTML files with charts and filters that work without a server.

Frontend
2298

senior-fullstack

by davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects,

Frontend
2896

shadcn-ui-setup

by maneeshanif

Install and configure Shadcn/ui component library with Radix UI primitives, Aceternity UI effects, set up components, and manage the component registry. Use when adding Shadcn/ui to a Next.js project or installing specific UI components for Phase 2.

Frontend
23167

screenshot-to-code

by OneWave-AI

Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.

Frontend
94209

theme-factory

by anthropics

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

Frontend
40139

markitdown

by K-Dense-AI

Convert various file formats (PDF, Office documents, images, audio, web content, structured data) to Markdown optimized for LLM processing. Use when converting documents to markdown, extracting text from PDFs/Office files, transcribing audio, performing OCR on images, extracting

Frontend
75173