-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making directional light follow the camera (fix some code in Viewer) #450
Comments
I assume the reason for this is so that the directional light's shadow projection frustum moves with the camera, so objects that are in range of the camera always have the directional light. That's the only one I could think of. |
k-aguete
pushed a commit
to k-aguete/ros3djs
that referenced
this issue
Oct 21, 2022
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.3 to 6.3.4. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](karma-runner/karma@v6.3.3...v6.3.4) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This worked well for me, we should use this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ros3djs/src/visualization/Viewer.js
Line 131 in 530f7ec
This is how:
But there is a much easier way that makes more sense: make the directional light a child of the camera, and make sure the camera is added to the scene. So removing that from the
draw()
method, we would instead replace the this in theconstructor
,with this,
. Now the light will move wherever the camera goes, without having to do any procedure to sync one matrix to the other.
The text was updated successfully, but these errors were encountered: