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

enable camera view offset in CSS3DRenderer #25508

Merged
merged 5 commits into from
Feb 17, 2023

Conversation

yomotsu
Copy link
Contributor

@yomotsu yomotsu commented Feb 14, 2023

Related issue: #21723

Description

Currently, CSS3DRenderer ignores camera.setViewOffset().
This PR is for enabling camera's viewOffset in CSS3DRenderer for both PerspectiveCamera and OrthographicCamera.

Also, I added viewOffset controls into:

  • examples/css3d_orthographic.html
  • examples/css3d_sandbox.html

p.mp4

o.mp4

const viewElement = document.createElement( 'div' );
viewElement.style.transformOrigin = '0 0';
viewElement.style.pointerEvents = 'none';
domElement.appendChild( viewElement );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned #21723 (comment)
a wrapper element is required to handle camera-view.

@mrdoob mrdoob added this to the r150 milestone Feb 15, 2023
@mrdoob mrdoob merged commit 202bbb7 into mrdoob:dev Feb 17, 2023
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.

2 participants