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

Set scene scale #14

Open
tancik opened this issue May 23, 2023 · 1 comment
Open

Set scene scale #14

tancik opened this issue May 23, 2023 · 1 comment
Labels
reasonable first issue Possibly good for newcomers

Comments

@tancik
Copy link
Collaborator

tancik commented May 23, 2023

Viser currently assumes the scene is roughly 10x10x10 which makes navigation difficult when your scenes are a very different scale. For example, nerfstudio is +-1. Users currently scale everything on the server side, but we should add the functionality to set the scene scale in viser.

One api possibility is,

viser_server = ViserServer()
viser_server.set_scale(10)
@tancik tancik added the reasonable first issue Possibly good for newcomers label May 23, 2023
@brentyi
Copy link
Collaborator

brentyi commented May 26, 2023

So I think there are two high-level options for what happens we call .set_scale():

  1. Track the scale entirely on the viser server side in Python. After .set_scale() is called, any positions we read or write can be scaled in Python by those coordinates. Sounds like a lot of boilerplate to me.
  2. Alternatively, send the scale value over to the client, and have the client just scale a threejs group that wraps everything. This could be roughly prototyped by adding a scale={[10.0, 10.0, 10.0]} here. The viewer camera isn't currently in this group and won't be scaled, but it seems possible to move it in.*

Does this make sense? Interested in thoughts from @cnnmon and/or @tancik

--

*edit: on second thought this1 is not a great idea, because a core problem is that we're initialized too far from the origin for the nerf use cases; if we scale both the scene and the camera things the end result is nothing really changes... instead maybe we scale the scene using the threejs scale, but then manually apply the scale parameter to the camera poses?

Footnotes

  1. edit 2: by "this" I meant moving the camera into the scaled group, which would scale both of them together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reasonable first issue Possibly good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants