Skip to content
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

Examples: Fix Resize Behaviour of ShadowMapViewer #11686

Merged
merged 1 commit into from Jul 5, 2017

Conversation

georgiee
Copy link

@georgiee georgiee commented Jul 4, 2017

Hello,
this is an easy fix for the ShadowMapViewer which can't handle a resize very well at the moment.

See for yourself:

  1. Open https://threejs.org/examples/#webgl_shadowmap_viewer
  2. Make the window smaller or larger

The two shadow HUDs in the top left will be stretched as the involved OrthographicCamera is not updated properly. My PR fixes this by updating the camera projection matrix and it also validates the size and position at the same place.

I tested it locally with the same example. Attached two gifs for demonstration purpose. Before and after.

Thanks.
Regards George

resize-current
resize-fixed

@mrdoob mrdoob merged commit 5036985 into mrdoob:dev Jul 5, 2017
@mrdoob
Copy link
Owner

mrdoob commented Jul 5, 2017

Thanks!

@georgiee georgiee deleted the fix-shadow-viewer branch July 5, 2017 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants