NerdLens:用纸板 VR 投屏你的电脑
NerdLens: Mirror your computer with cardboard VR

原始链接: https://github.com/ThatXliner/NerdLens

NerdLens 是一个开源的实验性项目,它能将你的 iPhone 和 Google Cardboard 头显转化为有线 VR 桌面显示器。该项目专为黑客和极客设计,通过 USB 通道将经过 JPEG 压缩的桌面画面直接传输至手机进行立体渲染,从而绕过云流媒体传输。 **主要功能:** * **有线性能:** 使用 `iproxy` 通过 USB 连接,实现低延迟传输。 * **可定制 VR:** 可将桌面显示器或特定窗口以 10–60 FPS 的帧率进行流式传输,并支持调整屏幕距离。 * **简化设置:** 基于 Tauri/Rust 桌面主机程序和 Unity iOS 客户端开发。 **要求:** * 一部 iPhone(iOS 13+)、一个兼容 Cardboard 的头显以及一根 USB 数据线。 * 开发工具:Unity 6、Xcode、Bun 和 Rust。 **状态:** NerdLens 目前处于早期概念验证阶段,并非成熟的消费级应用。它非常适合有兴趣进行实验、黑客开发或探索定制 VR 解决方案的用户。该项目开源(GPLv3),欢迎通过 GitHub 贡献代码。请注意,用户需要手动构建源码并进行技术配置。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 NerdLens:用硬纸板 VR 镜像你的电脑 (github.com/thatxliner) 9 积分,由 thatxliner 在 59 分钟前发布 | 隐藏 | 过往 | 收藏 | 2 条评论 ls-a 7 分钟前 [–] 又名廉价毁眼工具 回复 thatxliner 2 分钟前 | 父评论 [–] 在飞机上很有用 回复 考虑申请 YC 2026 年秋季班吧!申请截止日期为 7 月 27 日。 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

NerdLens logo

Put your computer screen in a headset you already own.
A wired, open-source VR desktop experiment for iPhone and Google Cardboard.

License: GPL-3.0 Project status: proof of concept


NerdLens captures your desktop, compresses it into JPEG frames, sends those frames over USB, and renders them on a virtual screen inside a stereoscopic Cardboard view. No expensive headset. No cloud streaming. Just a phone, a cardboard viewer, and an arguably unreasonable amount of curiosity.

Important

NerdLens is an early proof of concept, not a polished consumer app. The current mobile project targets iOS, requires a source build, and is best suited to hacking and experimentation.

  • Stream a selected display or window into VR at a configurable target of 10–60 FPS
  • Keep traffic on a wired USB tunnel through iproxy
  • Show a live preview, connection state, frame count, resolution, and target FPS
  • Move the virtual display closer or farther away without leaving the headset
  • Recover from interrupted frame writes with automatic reconnect attempts
  • Keep the iPhone awake during a viewing session
flowchart LR
    A["Desktop or window"] --> B["Svelte capture UI"]
    B -->|"JPEG frames"| C["Tauri / Rust host"]
    C -->|"TCP :12345"| D["iproxy USB tunnel"]
    D --> E["Unity iOS client"]
    E --> F["Texture on a VR display"]
    F --> G["Google Cardboard"]
    B -->|"distance setting"| C
Loading

The phone runs the TCP server; the desktop host connects to localhost:12345, which iproxy forwards to the attached iPhone. Each message starts with a one-byte type followed by a big-endian payload length and the payload itself.

Type Payload Purpose
0 none Keep-alive, reserved by the client
1 JPEG bytes Replace the texture shown in VR
2 UTF-8 JSON Update viewer settings such as display distance
  • macOS and Xcode
  • An iPhone running iOS 13 or newer
  • A Google Cardboard-compatible viewer
  • A USB cable
  • Unity Hub with Unity 6000.1.5f1 and iOS Build Support
  • Bun, Rust, and the Tauri system prerequisites
  • iproxy from libimobiledevice

Install iproxy with Homebrew:

brew install libimobiledevice

Then clone the project:

git clone https://github.com/ThatXliner/NerdLens.git
cd NerdLens

1. Build the iPhone client

  1. Open the Test0 directory in Unity Hub using Unity 6000.1.5f1.
  2. Open Assets/Scenes/SampleScene.unity.
  3. Switch the build target to iOS and build the Xcode project.
  4. Open the generated project in Xcode, select your development team, connect your iPhone, and run the app on the device.
  5. Place the phone in your Cardboard viewer after the app launches.

The Google Cardboard XR package is already declared in the Unity project and will be fetched by Unity Package Manager.

Connect and trust the iPhone, leave the NerdLens mobile app running, then start the tunnel in a separate terminal:

Keep this process running for the entire session.

3. Start the desktop host

cd desktop
bun install --frozen-lockfile
bun run tauri dev

In NerdLens:

  1. Select Connect.
  2. Select Start Recording and choose a display or window.
  3. Put on the headset.
  4. Use the Distance slider to place the screen comfortably.

That is it. Your monitor is now wearing a monitor.

Run these commands from desktop/:

# Start the Svelte frontend only
bun run dev

# Type-check the frontend
bun run check

# Build the frontend
bun run build

# Run the complete desktop app
bun run tauri dev

# Validate the Rust host
cargo check --manifest-path src-tauri/Cargo.toml
NerdLens/
├── desktop/                       # Tauri 2 + Svelte 5 screen-streaming host
│   ├── src/routes/+page.svelte   # Capture controls, preview, and statistics
│   └── src-tauri/src/lib.rs      # TCP protocol, retries, and Tauri commands
├── Test0/                         # Unity 6 iOS/Cardboard client
│   ├── Assets/ReceiveVideo.cs    # TCP server and frame/settings decoder
│   └── Assets/Scenes/            # VR scene
├── JOURNAL.md                     # Original build log
└── Logo.png

The host says it cannot connect

  • Launch the iPhone app before selecting Connect.
  • Confirm the phone is unlocked, trusted, and visible over USB.
  • Make sure iproxy 12345 12345 is still running.
  • Check that nothing else is using local port 12345.

The iOS build will not sign

  • Open the generated Xcode project and choose your Apple development team.
  • Give the app a unique bundle identifier if Xcode reports a conflict.
  • Confirm that the connected phone is enabled for development.

The stream freezes or stops

  • Stop and restart screen capture in the desktop host.
  • Restart iproxy, then disconnect and reconnect from NerdLens.
  • Try a lower target FPS; full-resolution JPEG encoding is intentionally simple in this prototype.

The view is uncomfortable

  • Adjust Distance before putting the phone back into the viewer.
  • Take regular breaks. This prototype does not yet include a complete comfort-calibration flow.

The wonderfully candid development story—including the failed first Unity project—is in the project journal.

Bug reports, experiments, protocol improvements, and delightfully overengineered ideas are welcome. Open an issue or send a pull request with a clear explanation of what changed and how you tested it.

NerdLens is free software released under the GNU General Public License v3.0.

联系我们 contact @ memedata.com