-
Notifications
You must be signed in to change notification settings - Fork 55
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
Viser's perspective projection #254
Comments
Hello! Yeah, unfortunately this just seems like a bug in the frustum math on your end. Maybe double-check that you're using the camera rotation correctly when you compute the frustum bounds? From what you've drawn it looks like the frustum you've computed is just not rotating correctly with the camera. |
Makes sense! Yeah, the rotation is stored as a quaternion here: |
Okay interesting! Instead of trying to rotate the frustum into the world frame, for me it's easier to visualize leaving the frustum at the camera frame origin but then transform the Gaussians so they're defined with respect to the camera. My high-level recommendation would be to:
Footnotes
|
Yes!
The camera frustum in the camera frame should have no rotation applied to it, since it's rigidly attached to the camera frame. So I think this should actually be easier than you'd expect. |
Is there a way to set the near and far clipping planes of the camera in a viser scene? |
Viser's perspective projection
I guess Viser uses perspective projection, then changes to Orthographics projection, and performs rendering. If an object is in ftustum, it will be rendered; if an object is not in ftustum, it will not be rendered.
Based on my speculation, I used CameraHandle.position,
CameraHandle.fov,
and CameraHandle.aspect.
Then I set up a near plane and far plane. I used the above 5 parameters to creat frustum (red part).
Now I am using Nefstudio's gaplat algorithm for training and have obtained many CKPT files. I generate a bounding box for each ckpt.If frustum intersects with the bounding box, I will read the ckpt. If frustum does not intersect with the bounding box, I will not read ckpt.
Now I have discovered a bug:
I use nerfview( https://github.com/hangg7/nerfview ).
When using the left arrow or right arrow on the keyboard to rotate, there may be some missing data in the scene. Because the bounding box of some data does not intersect with the frustum, so it did not participate in rendering.
I drew four points ABCD of the far plane in browser
Theoretically, points ABCD are located at the four corners of the screen.
But when I use the left arrow or right arrow on the keyboard, there are only 2 dots on the screen. Points B and D are outside.
My guess is that when I use the left arrow or right key on the keyboard, Frustum rotates, but something doesn't rotate together, causing misalignment, so some data is not displayed.
I tried my best to solve the bug, but I failed. Perhaps because I didn't know some key information about Viser.
Can you help me? Thank you very much.
The text was updated successfully, but these errors were encountered: