eth-ait / aitviewer

A set of tools to visualize and interact with sequences of 3D data.
MIT License
553 stars 49 forks source link

Position the camera to keep the whole motion in the field of view #11

Closed MarilynKeller closed 1 year ago

MarilynKeller commented 2 years ago

Hi, this is a feature suggestion.

The headless rendering is convenient, but often the subject gets out of the camera field of view during the motion sequences. It would be great to have the option to automatically position the camera such that the whole motion stays in the camera field.

Thanks for the great work :).

kaufManu commented 2 years ago

Thank you and thanks for the suggestion - I can see how this is useful and we'll take a look. Could you may be shed some more light on your use case? If there is an automatic way to position the camera, what would be the preferred way (or ways) of doing this? For example, would you like the camera to follow a certain (SMPL) vertex with a certain distance? Or would you like that in each frame the camera is re-positioned and re-oriented such that it looks at the center of the scene? In this case the resulting video will not be smooth, but depending on the use case that might not be important.

In the meantime, you could already do achieve this with the latest release using the newly introduced camera paths. You would have to compute the trajectory of the camera yourself though, such that the motion stays in the camera view. This example should demonstrate all you need for this.

kaufManu commented 1 year ago

This is now available via viewer.lock_to_node(...), cf. the headless rendering example for a reference how to use it. Feel free to open this issue again if anything comes up.