Animation Plugin: trajectory and viewports

For any question about plugins!
Post Reply
RobertK
Posts: 2
Joined: Tue May 14, 2024 11:38 pm

Animation Plugin: trajectory and viewports

Post by RobertK »

Hello to all! I am new to the forum and would like to begin by congratulating the developers of this excellent software.

I have been using the animation plugin and, after reviewing the wiki, Forum, and source code, I still have a couple of questions.

Animation Trajectory
The “Export trajectory on exit” option on the Animation page is very helpful. The trajectory, exported as a 3D Polyline, contains the camera position for some (not all) video frames. It would be even more helpful if it also included camera orientation (pitch, roll, yaw) for these frames. Could this be added to the plugin or is there another way to obtain this information?

CC BIN File Format
I would like to write my own code to read and write certain CC BIN files. The file format specification at https://www.cloudcompare.org/doc/wiki/index.php/BIN is quite general. Is there more specific documentation available for a Viewport saved to a BIN file? Are such specs available for other CC objects stored in BIN files?

Thanks in advance for any suggestions
daniel
Site Admin
Posts: 7747
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Animation Plugin: trajectory and viewports

Post by daniel »

Animation Trajectory: the plugin can only export a polyline for now... The other pieces of information would have to be exported as a series of 'viewport objects' I guess? As one 'viewport' object for each frame, or something like that. But that would require to modify the code of the plugin.

And sadly there's no standard way to export 'viewport' objects (or even a simple 'Coordinate system' entity).

And as for BIN files, there's no clear description of the format, as it's a serialization of the internal CC memory representation in a binary file (for the sake of speed). The format is quite complex and it changes from time to time. If you want to read (or write) a simple BIN file with a single object, that may be a little easier, but you will still have to follow the code of various inter-dependent classes responsible for saving or loading BIN files. The starting points being:
Daniel, CloudCompare admin
RobertK
Posts: 2
Joined: Tue May 14, 2024 11:38 pm

Re: Animation Plugin: trajectory and viewports

Post by RobertK »

Thank you for your reply and the background information. Starting with reading and writing a BIN file for a single Viewport sounds like a good idea, to gain some familiarity with the code. I have had a quick look at the segments you suggested and will do so in greater detail soon.

In the meantime, perhaps you could point me to the declaration of the Viewport object, if one exists. I cannot find "Viewport" anywhere in the code. What object or variable names should I be searching for?

Thanks again for helping a newcomer. :-)
daniel
Site Admin
Posts: 7747
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Animation Plugin: trajectory and viewports

Post by daniel »

See https://github.com/CloudCompare/CloudCo ... rtObject.h (it's part of the 'DB' library)
Daniel, CloudCompare admin
Post Reply