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

feat: added zoom scale param #103

Merged
merged 2 commits into from Nov 8, 2023
Merged

feat: added zoom scale param #103

merged 2 commits into from Nov 8, 2023

Conversation

cazala
Copy link
Member

@cazala cazala commented Nov 8, 2023

This PR adds the ability to increase the zoom via de zoomScale property. We were limiting the max zoom to a low value because it started clipping beyond a certain zoom level, but it was because of the camera.minZ value being too high, i set it to 0.1 and now we can put the camera really close to the avatar without clipping.

We need to be able to put the camera very close to the avatar face to generate the face snapshots for the profile-images research.

I didn't just increase the MAX_ZOOM value because that would change the way the zoom property behaves, and I didn't want to break anything in production. So instead I added this zoomScale which is 1 by default, but if necessary it can be used to make the zoom go beyond the MAX_ZOOM level.

Copy link

vercel bot commented Nov 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wearable-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2023 8:41pm

@@ -145,6 +145,7 @@ export async function createScene(
// Setup Camera
const camera = new ArcRotateCamera('camera', 0, 0, 0, new Vector3(0, 0, 0), root)
camera.position = new Vector3(config.cameraX, config.cameraY, config.cameraZ)
camera.minZ = 0.1
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes the clipping issue that prevented us from having higher zoom levels before

@cazala cazala merged commit 85b3326 into master Nov 8, 2023
3 checks passed
@cazala cazala deleted the feat/zoom-scale branch November 8, 2023 20:54
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