From 9b68954064e13278a893de2467e05a643e24ac10 Mon Sep 17 00:00:00 2001 From: Marco Fugaro Date: Mon, 30 Jan 2023 19:12:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20Take=20into=20consideration?= =?UTF-8?q?=20parent=20transforms,=20close=20#46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ProjectedMaterial.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectedMaterial.js b/src/ProjectedMaterial.js index 2d08417..0709d3e 100644 --- a/src/ProjectedMaterial.js +++ b/src/ProjectedMaterial.js @@ -285,7 +285,7 @@ export default class ProjectedMaterial extends THREE.MeshPhysicalMaterial { this.uniforms.viewMatrixCamera.value.copy(viewMatrixCamera) this.uniforms.projectionMatrixCamera.value.copy(projectionMatrixCamera) - this.uniforms.projPosition.value.copy(this.camera.position) + this.uniforms.projPosition.value.setFromMatrixPosition(modelMatrixCamera) this.uniforms.projDirection.value.set(0, 0, 1).applyMatrix4(modelMatrixCamera) // tell the shader we've projected