mitsuke-live
Version:
Real-time object detection library for web browsers using TensorFlow.js and YOLO
46 lines • 1.73 kB
TypeScript
import { ARDetection } from '../types';
/**
* Three.js Helper Functions for MitsukeLive
*
* Utility functions to simplify positioning and animating 3D objects
* based on MitsukeLive AR detection results. These helpers handle
* coordinate transformations, smooth animations, and common AR tasks.
*/
import * as THREE from "three";
/**
* Convert detection coordinates to normalized device coordinates (-1 to 1)
* @param centerX Center X coordinate in detection canvas
* @param centerY Center Y coordinate in detection canvas
* @param detectionWidth Detection canvas width
* @param detectionHeight Detection canvas height
* @returns Normalized coordinates for Three.js
*/
export declare function normalizeDetectionCoordinates(centerX: number, centerY: number, detectionWidth: number, detectionHeight: number): {
x: number;
y: number;
};
export interface ViewportConfig {
displayWidth: number;
displayHeight: number;
detectionWidth: number;
detectionHeight: number;
fov: number;
}
export interface SmoothTransformState {
targetPosition: THREE.Vector3;
targetRotation: THREE.Vector3;
targetScale: THREE.Vector3;
}
/**
* Create smooth transform state
*/
export declare function createSmoothTransformState(): SmoothTransformState;
/**
* Update smooth transform targets from AR detection
*/
export declare function updateSmoothTargets(state: SmoothTransformState, detection: ARDetection, viewport: ViewportConfig, halfTanFov: number, scaleMultiplier?: number): void;
/**
* Apply smooth interpolation to object
*/
export declare function applySmoothTransform(object: THREE.Object3D, state: SmoothTransformState, lerpFactor?: number): void;
//# sourceMappingURL=three-helpers.d.ts.map