huggingface / gsplat.js

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

How to adjust the axis of rotation? #66

Closed gotoeasy closed 4 months ago

gotoeasy commented 4 months ago

When the model's z-axis is not perpendicular to the ground plane, the rotation effect may feel unnatural, as is the case with this model: testmodel.splat.
testmodel.zip

I would like to rotate the model along an axis that is perpendicular to the ground. Are there any parameters available to adjust the axis of rotation?

jeyemwey commented 4 months ago

You can rotate the scene in the beginning to match the rendering axes, as seen i.e. in my scenes: https://github.com/jeyemwey/webxr-gsplats/blob/main/src/GSplatPrograms/prepare-scene.ts You can create a Rotation Matrix from an axis, for this you place a vector "on the ground" and then rotate it until it's flat. It's a little bit of tryout, I have not yet found a perfect solution that works automatically.

(It might be a perfect case for RANSACing a plane from the ground, if someone is looking for a research project).

gotoeasy commented 4 months ago

You can rotate the scene in the beginning to match the rendering axes, as seen i.e. in my scenes: https://github.com/jeyemwey/webxr-gsplats/blob/main/src/GSplatPrograms/prepare-scene.ts You can create a Rotation Matrix from an axis, for this you place a vector "on the ground" and then rotate it until it's flat. It's a little bit of tryout, I have not yet found a perfect solution that works automatically.

(It might be a perfect case for RANSACing a plane from the ground, if someone is looking for a research project).

Thank you very much.