Looking-Glass / looking-glass-webxr

WebXR for Looking Glass displays
https://docs.lookingglassfactory.com/developer-tools/webxr
Apache License 2.0
66 stars 16 forks source link

Added external calibration data support #56

Open SinanAkkoyun opened 1 month ago

SinanAkkoyun commented 1 month ago

Why?

Bridge was laggy for my Linux system (and non-existent for ARM architecture). This way, one does not need the Bridge as every calibration data is being hardcoded. (to obtain initial calibration data, you can get the .calibration data and console.log it)

Example usage:


export const initWebXR = () => {
  const config = LookingGlassConfig;
  config.targetY = 0;
  config.targetZ = 0;
  config.targetDiam = 4;
  config.fovy = (1 * Math.PI) / 180;
  config.depthiness = 1;

  const lgPolyfill = new LookingGlassWebXRPolyfill();
    lgPolyfill.setCalibration({
        configVersion: "3.0",
        pitch: { value: 52.594383239746094 },
        slope: { value: -7.21152925491333 },
        center: { value: 0.40277382731437683 },
        viewCone: { value: 40 },
        invView: { value: 1 },
        verticalAngle: { value: 0 },
        DPI: { value: 324 },
        screenW: { value: 1536 },
        screenH: { value: 2048 },
        flipImageX: { value: 0 },
        flipImageY: { value: 0 },
        flipSubp: { value: 0 },
        serial: "LKG-PORT-",
        subpixelCells: [],
        CellPatternMode: { value: 0 },
        // fringe: { value: 0 },
    })

  return config
};
vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
looking-glass-webxr ✅ Ready (Inspect) Visit Preview Oct 5, 2024 4:27pm