VideoQuest / src /lib /sphericalToCartesian.ts
jbilcke-hf's picture
jbilcke-hf HF staff
working on coordinate conversion
a60cb50
raw
history blame
222 Bytes
function sphericalToCartesian(yaw: number, pitch: number, width: number, height: number): { x: number, y: number } {
const x = ((yaw + 180) / 360) * width;
const y = ((pitch + 90) / 180) * height;
return { x, y };
}