threepipe
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

123456789
  1. import {MathUtils, Vector2} from 'threepipe'
  2. export const computeFocalLengths = (width: number, height: number, fov: number, aspect: number, dpr: number) => {
  3. const fovRad = MathUtils.degToRad(fov)
  4. const fovXRad = 2 * Math.atan(Math.tan(fovRad / 2) * aspect)
  5. const fy = dpr * height / (2 * Math.tan(fovRad / 2))
  6. const fx = dpr * width / (2 * Math.tan(fovXRad / 2))
  7. return new Vector2(fx, fy)
  8. }