Skip to content

Anil-CAI/ar_vr_draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽจ VR Air Draw

An immersive WebXR application for painting floating 3D strokes in virtual space using VR hand controllers


๐Ÿ“– What is VR Air Draw?

VR Air Draw is an immersive WebXR application that lets users physically paint floating 3D strokes in virtual space using VR hand controllers โ€” with a fully interactive virtual dashboard for color, thickness, clear, and save controls, all usable from inside the headset without breaking immersion.

Put on a VR headset, press the trigger, and draw anything โ€” floating sculptures, diagrams, freeform art โ€” suspended in 3D space around you.


๐ŸŽฏ Project Significance

This project is a deep exploration of WebXR and real-time 3D interaction design:

  • VR/XR Game Development โ€” Real-time 3D rendering, spatial controller tracking, raycasting interaction, and immersive UX design using WebXR and Three.js.

This is not a tutorial clone โ€” it is a custom-built VR creative tool running entirely in a browser with no app store installation required.


โœจ Key Features

๐ŸŽจ 3D Air Drawing System

Feature Description
Real-time stroke rendering Trigger-held XYZ coordinates are instantly connected into 3D line geometry
Multi-stroke support Multiple independent floating strokes built separately in one session
Virtual dashboard Collision-detectable VR menu with interactive buttons inside the headset
Raycasting interaction Controller laser ray detects dashboard button intersections precisely
Thickness control + / - buttons adjust stroke width for all new lines dynamically
Color randomizer One-tap color cycling algorithm changes stroke color on demand
Clear & Save Full scene clear or export all 3D coordinate + color data as a structured file

๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           VR HEADSET (WebXR)            โ”‚
โ”‚                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚         3D Air Drawing           โ”‚   โ”‚
โ”‚  โ”‚                                  โ”‚   โ”‚
โ”‚  โ”‚  Right Trigger held              โ”‚   โ”‚
โ”‚  โ”‚  โ†’ Track XYZ controller position โ”‚   โ”‚
โ”‚  โ”‚  โ†’ Connect points โ†’ Line geometryโ”‚   โ”‚
โ”‚  โ”‚  โ†’ Render stroke in 3D scene     โ”‚   โ”‚
โ”‚  โ”‚                                  โ”‚   โ”‚
โ”‚  โ”‚  VR Dashboard (raycasting)       โ”‚   โ”‚
โ”‚  โ”‚  โ†’ Color ยท Thickness ยท Clear     โ”‚   โ”‚
โ”‚  โ”‚  โ†’ Save strokes to file          โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                         โ”‚
โ”‚  Three.js renderer โ†’ WebXR session      โ”‚
โ”‚  Stereoscopic output to headset lenses  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Technologies Used

Frontend โ€” VR Application

  • WebXR API โ€” Headset session management, stereoscopic rendering, spatial controller tracking
  • Three.js โ€” 3D scene, line geometry, raycasting, VR dashboard rendering
  • JavaScript (ES Modules) โ€” Controller event handling, drawing logic, stroke management
  • Vite โ€” Build tool and local development server
  • TLS/SSL Certificates โ€” HTTPS hosting required by browser VR APIs

๐Ÿš€ Getting Started

Prerequisites

Node.js v18+     npm / yarn
A WebXR-compatible browser (Chrome / Edge)
A VR headset (Meta Quest recommended) or WebXR emulator

1. Clone the Repository

git clone https://github.com/Anil-CAI/vr_airdraw.git
cd vr_airdraw

2. Install Dependencies

npm install

3. Start the HTTPS Development Server

# WebXR requires HTTPS โ€” run with SSL
npm run dev -- --https

# Or for production build:
npm run build && npm run preview

4. Open in VR

  1. Connect your VR headset to the same local network
  2. Open the HTTPS URL in your headset browser (Meta Quest Browser recommended)
  3. Press "Enter VR"
  4. Hold right trigger โ†’ move your hand to draw floating 3D strokes
  5. Aim at the dashboard buttons โ†’ trigger to interact (color, thickness, clear, save)

๐Ÿ“ Project Structure

vr_airdraw/
โ”‚
โ”œโ”€โ”€ index.html                  # App entry point + HTTPS VR launcher
โ”œโ”€โ”€ main.js                     # Core VR app logic
โ”‚   โ”œโ”€โ”€ setupScene()            # Three.js scene, camera, renderer
โ”‚   โ”œโ”€โ”€ trackControllers()      # WebXR controller pose tracking
โ”‚   โ”œโ”€โ”€ handleDrawing()         # Trigger โ†’ XYZ โ†’ 3D line geometry
โ”‚   โ””โ”€โ”€ handleDashboard()       # Raycasting VR menu interaction
โ”‚
โ”œโ”€โ”€ style.css                   # Pre-VR dashboard UI styling
โ”œโ”€โ”€ package.json                # Frontend dependencies
โ””โ”€โ”€ vite.config.js              # Build + HTTPS config

๐Ÿ—บ๏ธ Roadmap

  • WebXR session with dual controller tracking
  • Real-time 3D line drawing with trigger input
  • Multi-stroke support โ€” independent floating strokes
  • VR dashboard with raycasting button interaction
  • Color randomizer and stroke thickness controls
  • Clear all strokes from scene
  • Save all 3D stroke data as structured file
  • Hand tracking support โ€” draw without physical controllers
  • Haptic feedback โ€” feel texture while drawing
  • 3D brush shapes โ€” draw with spheres, cubes, ribbons instead of lines
  • Undo / redo stroke history
  • Drawing export to .glb / .obj 3D file format
  • Multi-user session โ€” collaborate in the same drawing canvas over WebRTC
  • Gallery mode โ€” load and view previously saved drawings in VR

๐Ÿ”ฌ Skills Demonstrated

This project demonstrates a focused and production-relevant skill set for VR game development and XR engineering roles:

Domain Skills Demonstrated
VR Development WebXR session management, stereoscopic rendering, spatial controller tracking
3D Graphics Three.js real-time geometry, raycasting, material rendering, scene management
Immersive UX Design In-VR dashboard interaction, spatial UI layout, controller-native controls
Procedural Generation Real-time XYZ coordinate capture and dynamic 3D line geometry construction
JavaScript Engineering ES Modules, event-driven controller input, file export via Blob API
Web Standards WebXR API, HTTPS/TLS hosting, browser-native VR without app store

๐Ÿ‡ฏ๐Ÿ‡ต Japan Career Relevance

This project directly maps to the technical work done at Japan's leading XR and game development companies:

ๆ—ฅๆœฌ่ชž: ใ“ใฎใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใฏWebXRใจThree.jsใ‚’ไฝฟใฃใŸVR็ฉบ้–“ๆ็”ปใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใงใ™ใ€‚ใ‚ฝใƒ‹ใƒผใƒปใ‚คใƒณใ‚ฟใƒฉใ‚ฏใƒ†ใ‚ฃใƒ–ใ‚จใƒณใ‚ฟใƒ†ใ‚คใƒณใƒกใƒณใƒˆใ‚„ใƒใƒณใƒ€ใ‚คใƒŠใƒ ใ‚ณใชใฉใ€ๆ—ฅๆœฌใฎใ‚ฒใƒผใƒ ไผๆฅญใงๅƒใใ“ใจใŒ็›ฎๆจ™ใงใ™ใ€‚

(This project is a VR spatial drawing application built with WebXR and Three.js. My goal is to work at Japanese game companies such as Sony Interactive Entertainment and Bandai Namco.)


๐Ÿ”— Related Projects

Project Description
๐ŸŒŒ Galaxy Cinema VR WebXR virtual cinema โ€” local video playback in an immersive galaxy environment
๐Ÿค– ROS Turtlesim Guide ROS2 robot control fundamentals using Turtlesim simulation

๐Ÿ‘ค About the Developer

Anil Kumar โ€” VR Game Developer & Robotics Engineer from India, building toward a career in Japan's XR and robotics industry.

  • Currently learning: ROS2 ยท C++ ยท OpenXR ยท Japanese (JLPT N5)
  • Open to: VR Developer / XR Game Engineer roles in Japan

๐Ÿ“„ License

This project is open source under the MIT License.


Built to explore the frontier of VR creative tools and immersive 3D interaction ยท India โ†’ Japan ๐Ÿ‡ฎ๐Ÿ‡ณ โ†’ ๐Ÿ‡ฏ๐Ÿ‡ต

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors