Skip to content

Commit 01ebf7d

Browse files
committed
Fix picking
1 parent 7a4dd73 commit 01ebf7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webgl/lessons/webgl-picking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,8 @@ objects.forEach(function(object) {
634634

635635
const subLeft = left + pixelX * width / gl.canvas.width;
636636
const subBottom = bottom + pixelY * height / gl.canvas.height;
637-
const subWidth = 1 / gl.canvas.width;
638-
const subHeight = 1 / gl.canvas.height;
637+
const subWidth = width / gl.canvas.width;
638+
const subHeight = height / gl.canvas.height;
639639

640640
// make a frustum for that 1 pixel
641641
const projectionMatrix = m4.frustum(

0 commit comments

Comments
 (0)