question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix light helpers: change `updateMatrixWorld()` to `updateWorldMatrix()`

See original GitHub issue

Continuing the spirit of fixing issues like #19962 (see PR https://github.com/mrdoob/three.js/pull/19969 and https://github.com/mrdoob/three.js/pull/20224 as example fixes), we need to update these lines:

AS A BONUS: There are a two related issues to fix:

  1. Remove this line … because it is already done in the constructor.
  2. For both DirectionalLightHelper and SpotLightHelper, we need to do this.light.target.updateWorldMatrix(true, false) … because currently this.light is updated but not this.light.target, so you get a bug because the helper shows the wrong direction for these lights (this happens in my app – I have a runtime patch right now to fix this bug).

If this all sounds good to the maintainers, I will send a PR. Let me know.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
acu192commented, Apr 8, 2021

I’m closing this (again) and will instead contribute to the discussion @Mugen87 linked above (https://github.com/mrdoob/three.js/pull/21427).

0reactions
Mugen87commented, Apr 8, 2021

Related #21427.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object3D.getWorld*() should call updateWorldMatrix(true) ...
When we call Object3D.getWorld*(), we want object.parent.matrixWorld to be updated, but not it's children. is this a bug?
Read more >
Object3D#updateMatrixWorld
Object3D. This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in...
Read more >
object.updateWorldMatrix is not a function - three.js
As documentation of Three.js said, after changing the position of the camera, we must call the updateProjectionMatrix() method.
Read more >
Developing with three.js
js provides helpers to make them easier. Local to World Transforms. Normally, we'd need to call .updateMatrixWorld () on parent Object3D s, but...
Read more >
Three.js Aligning HTML Elements to 3D
function render() { · renderRequested = false; · if (resizeRendererToDisplaySize(renderer)) { · const canvas = renderer.domElement; · camera.aspect = canvas.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found