drone-camera 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ npm install -D @types/three
|
|
|
50
50
|
import * as THREE from 'three'
|
|
51
51
|
import { WebGPURenderer } from 'three/webgpu'
|
|
52
52
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'
|
|
53
|
-
import { createDroneControl,
|
|
53
|
+
import { createDroneControl, DroneControlPanel } from 'drone-camera'
|
|
54
54
|
|
|
55
55
|
const scene = new THREE.Scene()
|
|
56
56
|
const camera = new THREE.PerspectiveCamera(60, innerWidth / innerHeight, 0.1, 4000)
|
|
@@ -64,7 +64,7 @@ const controls = new OrbitControls(camera, renderer.domElement)
|
|
|
64
64
|
const drone = await createDroneControl({ engine: 'three', scene, camera, renderer, controls })
|
|
65
65
|
|
|
66
66
|
// Native DOM panel: arm/takeoff/land, sticks, flight modes, camera views, photo & video.
|
|
67
|
-
new
|
|
67
|
+
new DroneControlPanel(drone)
|
|
68
68
|
|
|
69
69
|
renderer.setAnimationLoop(() => {
|
|
70
70
|
drone.animate()
|
|
@@ -88,7 +88,7 @@ await loadCesiumScript('/Cesium/Cesium.js')
|
|
|
88
88
|
// ENU/ECEF earth coordinates; origin altitude auto-sampled from terrain
|
|
89
89
|
const drone = await createDroneControl({ engine: 'cesium', viewer, lon: 116.391, lat: 39.906 })
|
|
90
90
|
|
|
91
|
-
// Same panels —
|
|
91
|
+
// Same panels — new DroneControlPanel(drone) works unchanged.
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
## Features
|
|
@@ -108,10 +108,12 @@ const drone = await createDroneControl({ engine: 'cesium', viewer, lon: 116.391,
|
|
|
108
108
|
## Panorama in three lines
|
|
109
109
|
|
|
110
110
|
```ts
|
|
111
|
-
import {
|
|
111
|
+
import { CaptureService, PanoramaCapture } from 'drone-camera'
|
|
112
112
|
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const capture = new CaptureService({ provider: drone }) // drone = your engine host
|
|
114
|
+
const session = capture.createSession({ source: 'virtual-camera', name: 'Around the tower' })
|
|
115
|
+
const pano = new PanoramaCapture(capture)
|
|
116
|
+
await pano.start(session.id, 'pano-360') // body spins for yaw, gimbal stacks pitch rows
|
|
115
117
|
```
|
|
116
118
|
|
|
117
119
|
Stitching exploits the fact that every shot's camera pose is known exactly — images are back-projected onto the equirectangular canvas, no feature matching or OpenCV involved.
|
|
@@ -139,7 +141,7 @@ The repo ships `mcp/drone-mcp-server.mjs` — a stdio MCP server exposing the ru
|
|
|
139
141
|
|
|
140
142
|
```
|
|
141
143
|
┌───────────────────────── UI (plain DOM, framework-free) ─────────────────────────┐
|
|
142
|
-
│
|
|
144
|
+
│ DroneControlPanel MissionPanel CapturePanel MiniMap Gallery │
|
|
143
145
|
└──────────────────────────────────────┬───────────────────────────────────────────┘
|
|
144
146
|
│ host interfaces (not inheritance)
|
|
145
147
|
┌──────────────────────────────────────┴───────────────────────────────────────────┐
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drone-camera",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Framework-agnostic drone control library for the browser: one zero-dependency flight core driving both three.js and CesiumJS backends, with capture, panorama stitching and mission editing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"drone",
|