@qctrl/visualizer
Version:
The Q-CTRL Visualizer is a package for displaying animated 3d Bloch sphere visualizations.
19 lines (18 loc) • 654 B
TypeScript
import { Object3D, PerspectiveCamera } from "three";
interface GetClientXYofThreeObject {
obj: Object3D;
width: number;
height: number;
camera?: PerspectiveCamera;
viewportDiv: HTMLElement;
perspective: number;
}
/**
* Takes a three.js object and a scene element object (containing a three js camera and a positioning/layout div) and derives the window/client x y equivalent coordinates from the three js object's 3d coordinates
*/
export default function getClientXYofThreeObject({ obj, width, height, camera, viewportDiv, perspective, }: GetClientXYofThreeObject): {
x: number;
y: number;
z: number;
};
export {};