Skip to content

Instantly share code, notes, and snippets.

@112KA
Created May 20, 2022 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 112KA/ac3696237a5fe78fe1d4d97cec47b968 to your computer and use it in GitHub Desktop.
Save 112KA/ac3696237a5fe78fe1d4d97cec47b968 to your computer and use it in GitHub Desktop.
updateMatrixWorld(force) {
if (this.matrixWorldNeedsUpdate || force) {
if (this.visible) {
const cameraObject = camera.activeCamera.instance
this.quaternion.copy(this.parent.quaternion)
this.quaternion.conjugate()
this.quaternion.multiply(cameraObject.quaternion)
_modelViewMatrix.multiplyMatrices(cameraObject.matrixWorldInverse, this.matrixWorld)
_mvPosition.setFromMatrixPosition(_modelViewMatrix)
this.scale.set(1, 1, 1)
this.scale.multiplyScalar(-_mvPosition.z / 4)
}
}
super.updateMatrixWorld(force)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment