Skip to content

Commit

Permalink
[sky] apply padding to skybox matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivovandongen committed Dec 14, 2020
1 parent 4cbccae commit d52d105
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/geo/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,9 @@ class Transform {
mat4.rotateZ(view, view, this.angle);

const projection = mat4.perspective(new Float32Array(16), this._fov, this.width / this.height, nearZ, farZ);
// Apply center of perspective offset to skybox projection
projection[8] = -offset.x * 2 / this.width;
projection[9] = offset.y * 2 / this.height;
this.skyboxMatrix = mat4.multiply(view, projection, view);

// Make a second projection matrix that is aligned to a pixel grid for rendering raster tiles.
Expand Down

0 comments on commit d52d105

Please sign in to comment.