I am working on making an animation by continuously loading objects frame by frame with ply loader or draco loader.
After loading all the files, we are adding them to the scene one by one.
But I want to render in real time as it loads.
It takes too long to load one object. (about 200ms)
It seems to be because of the parsing time of the ply loader. Can I reduce the parsing time by using multithreading or something?
(e.g. how to use workers)
Or is there another way to make it look like an animation by loading multiple frames in succession?
please help me
You can move the entire loading process to a worker and then move the geometry data back to the main thread. However, this setup is not without overhead and it depends on the use case whether you end up with a faster overall execution time or not.
I guess you have to find out first if the object transmission over the network is the problem. If so, using a worker won’t help. Using DRACO compression could help in this context.
If the actual parsing of the PLY asset is the issue, consider to use glTF. It would also allow to easily combine DRACO compression.
Thanks for your reply.
There are several files. I want to render them one by one so that they appear to be moving. like a video
Any examples on how to concatenate the gltf frame by frame to make it look like an animation?
No, there isn’t, sorry. Usually, a model and its animations are defined in a single glTF asset. When loading the asset, the animations are automatically parsed as animation clips which can then be played via
Depending on the frame rate of you geometry sequence, you probably have to represent each file as a single mesh/point cloud or line (depending on your geometry type), render it for a few frames and then switch to the next one.
If the structure of the geometries are equal across the entire sequence (meaning the number of vertices, normals etc.), you could also use morph target animation. Meaning you have a base geometry and all other files are a single morph attributes.
Or you try to create an animation clip offline by merging the geometries somehow. However, I’m not sure how to properly do this.
Thank you. I’ll think of another way.
See this thread: Quill VR animation to .glb - #5 by Fried-Unicorn
Not the most efficient way to do animation, skinning and morph targets are usually more efficient, but it can be done.