huggingface / gsplat.js

JavaScript Gaussian Splatting library.
MIT License
1.26k stars 77 forks source link

How to render from a set of camera position? #64

Closed vahidEtt closed 4 months ago

vahidEtt commented 4 months ago

Hi, I am trying to render the scene from a set of camera position/rotation that I load from a JSON file.

I think the right way is first to disable the "orbitControls" (engine.orbitControls.enabled = false;) and then set the camera position/rotation manually like this: 'camera.data.update(position, rotation);'. Am I right?

Any suggestion/recommendation is welcome!

dylanebert commented 4 months ago

You can simply not create or update the orbit controls :)

And then you should just be able to specify: camera.position = camera.rotation = before rendering

Check out the camera update example: https://github.com/huggingface/gsplat.js/blob/main/examples/camera-updates/src/main.ts