Forum

How to make an object's mesh different for each frame?

16 March 2016 02:56
Is there a way in Blend4Web to have an object that changes its mesh data in each frame?
An example of such an object would be a fluid sim (low poly, of course), or other object that dynamically changes topology. I'm fairly sure this will require baking, but assuming we have baked meshes, then is there a way to do this?
Thanks.
16 March 2016 13:02
Hi,
Ответ на сообщение пользователя Mentalist
Is there a way in Blend4Web to have an object that changes its mesh data in each frame?
An example of such an object would be a fluid sim (low poly, of course), or other object that dynamically changes topology. I'm fairly sure this will require baking, but assuming we have baked meshes, then is there a way to do this?
Thanks.
Do you mean vertex animation? Then please take a look at these materials:
https://www.blend4web.com/doc/en/animation.html#id7
https://www.blend4web.com/en/article/48/
The Founder | Twitter | Facebook | Linkedin
17 March 2016 12:43
Thank you, Yuri.

I took a look at the links you shared. I don't think what I'm talking about qualifies as "vertex animation" because the vertices in mine are not "moving", they are being completely swapped out in each frame.
(I could be misunderstanding the definition of "vertex animation" though.)
In the flag example, the vertices are changing location, but it's the same set of vertices - the same mesh.

To demonstrate what I mean, I have constructed a demo scene of a simple fluid sim.

Download the source .blend
View the compiled .html



Since the mesh must actually be a different mesh in each frame, the only way I knew how to do that was by using a series of Show/Hide nodes in the Logic Editor. But then many objects are required, and each object must have the same settings. Managing many objects as if they are one is not very elegant, so my question is: is there a better way to do this than the way I did it? (Hopefully a way that allows many meshes to be cycled through inside one single object.)

Thank you for your help!
 
Please register or log in to leave a reply.