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

I want to develop a Python function that automatically limits the maximum height of the camera, which is the Z-value #242

Open
smart4654154 opened this issue Jul 12, 2024 · 1 comment

Comments

@smart4654154
Copy link

Thank you very much for your work. Now I have a big scene and I want to limit the maximum height of the camera, which is the Z-value.
I should modify this: viser/src/viser/client/src/CameraControls.tsx
Write some codes:
const boundaryBox = new THREE.Box3();
boundaryBox.min.set(-999.0, -999.0, -0.49);
boundaryBox.max.set(999.0, 999.0, 0.49);

However, every time I change a scene, I need to manually set boundaryBox.min.set, boundaryBox.max.set。
I want to create a Python function to automatically set the height of the camera.
This seems to be related to web development, unfortunately I know nothing about it
Can you teach me or provide me with some reference materials?
Thank you very much.

@brentyi
Copy link
Collaborator

brentyi commented Jul 16, 2024

Hi! One thing you could do is trace how messages in viser are defined, wrapped, and ultimately handled.

One relatively simple example I can recommend is the ResetSceneMessage: https://github.com/search?q=repo%3Anerfstudio-project%2Fviser+ResetSceneMessage&type=code

You could define your own message with the functionality that you're looking for.

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

No branches or pull requests

2 participants