nerfstudio-project / viser

Web-based 3D visualization + Python
https://viser.studio/latest
Apache License 2.0
596 stars 31 forks source link

how this project achieves mouse wheel scaling? #187

Open smart4654154 opened 3 months ago

smart4654154 commented 3 months ago

Hello, thank you very much for your work, I want to control the display range. I would like to ask how this project achieves mouse wheel scaling, left mouse button or keyboard up, down, left and right keys to control rotation, and right mouse button or WASD keys to control position movement. (Example as shown in the figure) As a beginner, I cannot find the corresponding code. Can you tell me what the relevant code is so that I can modify it? Thank you? 滚轮

brentyi commented 3 months ago

Hi! You can find it in CameraControls.tsx: https://github.com/nerfstudio-project/viser/blob/main/src/viser/client/src/CameraControls.tsx

smart4654154 commented 3 months ago

Thank you very much. Specifically, I want to implement my features in the new version of the viewer in nerfstudio, But there is no CameraControls.tsx in nerfstudio. Can you tell me the code in nerfstudio that controls this feature?

By the way, I have a question about Crop scale. Do you have time to take a look at this issue? https://github.com/nerfstudio-project/nerfstudio/issues/1606 image

brentyi commented 3 months ago

The latest version of nerfstudio just uses viser as a dependency, so if you make a change to viser (eg a clone of it that you do an editable install of with pip install -e .) it should be reflected there!

Other issue: will take a look and respond in the other repo.

smart4654154 commented 3 months ago

thank you very much. I have successfully implemented the control of the roller, and this is my process to share with those in need Viser can be installed on Linux and can be installed on Win10(fellow this https://github.com/nerfstudio-project/viser/issues/179

This is my experimental procedure: I should have installed nerfstudio properly Then pip uninstall viser And then git clone https://github.com/nerfstudio-project/viser.git cd/ viser Pip install - e. if you use Win10, I think you may encounter error. You can fellow this https://github.com/nerfstudio-project/viser/issues/179 Find viser/blob/main/src/visitor/client/src/CameraControls.tsx and modify CameraControls.tsx Run ns-viewer –load-config data/path in nerfstudio you will be able to control the range of the scroll wheel.