Jump to content

Many people perform long time animation


andyZou
 Share

Recommended Posts

Recently I need to produce about 5 minutes of animation(more than twenty dirfferent people perform this animation ),How to use babylonjs to achieve this goal.
Currently think of two ways:
  1. use 3DMax to make whole animation, then import it.But the problem is data file is so big and how to achieve the goal of different people perform?
  2. animation split into a small module,then import them in turn,But question is How to control the order of each small module?

Finally, What is a good way to achieve the goal of different people perform the same animation efficient?

Sincere thanks.
Link to comment
Share on other sites

@andyZou

This is what I imagine you want but at times my imagination is too complex.

Animator A, is creating animation A which uses one or more animated meshes. Animation runs from time T[A][0] to T[A][1]. Each animation is saved to a file. These files are imported into Babylonjs. Each file needs to be played at the correct time. Is this possible?

Is this close to what you need?

EDIT reading your later message seems I have got it wrong (again :( )

Link to comment
Share on other sites

14 hours ago, Deltakosh said:

Hello!

I'm not sure to get what you want to achieve. What do you mean by "different people". Are you talking about bones/skeletons? If yes then you can simply create your animation on a specific mesh in 3dsmax and then clone this mesh using javascript.

@Deltakosh

Well, I mean twenty people play the same long time animation.How to fix the problem of data file is so big?

Now, I doped out a solution to the problem:

  1.  import a mesh with skeleton animation.
  2.  import another nineteen mesh without skeleton animation and copy the skeleton animation to them
  3. play whole roles animation

But my code doesn't work.

Here's my code:

var dude;
BABYLON.SceneLoader.ImportMesh("", "./data/char/", "char1.babylon", scene, function (newMeshes, particleSystems, skeletons) {
                dude = newMeshes[0];
            }, function(progress) {
                if(progress.total == progress.loaded) {
                    for(var i=1; i<=12; i++) {
                        BABYLON.SceneLoader.ImportMesh("", "./data/woman/", "woman_static_"+i+".babylon", scene, function (newMeshes, particleSystems, skeletons) {
                            var position = new BABYLON.Vector3(Math.random()*100 / 10 - 5, 0, -2);
                            for(var i=0; i<newMeshes.length; i++) {
                                newMeshes[i].position = position;
                            }
							for (var i = 0; i < dude.skeletons.length; i+=1) {
								skeletons[i] = dude.skeletons[i].clone("skeleton clone #"+i);
								scene.beginAnimation(skeletons[i], 0, 120, 1.0, true);
							}
            			});
                    }
                }
            });

Thanks.

 

Link to comment
Share on other sites

var dude;
BABYLON.SceneLoader.ImportMesh("", "./data/char/", "char1.babylon", scene, function (newMeshes, particleSystems, skeletons) {
                dude = newMeshes[0];
                    for(var i=1; i<=12; i++) {
                        BABYLON.SceneLoader.ImportMesh("", "./data/woman/", "woman_static_"+i+".babylon", scene, function (newMeshes, particleSystems, skeletons) {
                            var position = new BABYLON.Vector3(Math.random()*100 / 10 - 5, 0, -2);
                            for(var i=0; i<newMeshes.length; i++) {
                                newMeshes[i].position = position;
                            }
							for (var i = 0; i < dude.skeletons.length; i+=1) {
								skeletons[i] = dude.skeletons[i].clone("skeleton clone #"+i);
								scene.beginAnimation(skeletons[i], 0, 120, 1.0, true);
							}
            			});
                    }
            });

This should work better

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...