Skip to content

Commit

Permalink
Merge pull request #1098 from Kurtil/patch-13
Browse files Browse the repository at this point in the history
fix ray picking -> RenderBuffer read y
  • Loading branch information
xeolabs authored Jul 11, 2023
2 parents 70df761 + 31cd2fb commit 46903a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/viewer/scene/webgl/RenderBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class RenderBuffer {

read(pickX, pickY, glFormat = null, glType = null, arrayType = Uint8Array, arrayMultiplier = 4) {
const x = pickX;
const y = (this.buffer.height || this.gl.drawingBufferHeight) - 1 - pickY;
const y = (this.buffer.height || this.gl.drawingBufferHeight) - pickY;
const pix = new arrayType(arrayMultiplier);
const gl = this.gl;
gl.readPixels(x, y, 1, 1, glFormat || gl.RGBA, glType || gl.UNSIGNED_BYTE, pix, 0);
Expand Down Expand Up @@ -339,4 +339,4 @@ class RenderBuffer {
}
}

export {RenderBuffer};
export {RenderBuffer};

0 comments on commit 46903a5

Please sign in to comment.