Wemperer2 Posted January 26, 2017 Share Posted January 26, 2017 I intend to import some models and animations I created in Blender but I have no idea how games incorporate animations. Since I plan on making a mobile game, I'm concerned complex models on top of intricate animations will ruin my project. I understand how 3D video animation works in regards to rendering the animation (taking hundreds of thousands of pictures) but how does this work in games? Does everything that moves pre-rendered and just played upon certain triggers or does the cpu/gpu calculate/manipulate meshes on certain triggers? Sorry if this doesn't make sense but I have the feeling I'm going to end up with a bunch of animation files for each model, for each type of movement and depending on how large these files are, may render a mobile game I want to make impossible. Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 26, 2017 Share Posted January 26, 2017 Hi and welcome from me. Here is a game made with BabylonJS http://cdn.babylonjs.com/wwwbabylonjs/Scenes/prosecution/index.html a lot going on and plays well. Not sure if it uses animation objects for the animation or not but a good example of a BJS game. More examples can be found here http://babylonjs.com/ To learn about using animation objects have a read and play with these http://babylonjsguide.github.io/basics/Starter http://babylonjsguide.github.io/basics/Combine http://babylonjsguide.github.io/gamelets/Sequence and of course the official documentation http://doc.babylonjs.com/tutorials/animations http://doc.babylonjs.com/classes/2.5/animation http://doc.babylonjs.com/classes/2.5/animationevent One thing to note is the difference between the scene frames and animation frames when an animation object has been created. Scene frames have a target render rate of 60 frames per second (fps) which can lower if the scene contains many vertices. Even a stationary mesh is rendered scene frame by scene frame to deal with camera movement. In this case scene frame 600 may be rendered at a time greater than 10 seconds. It is possible to use scene.registerBeforeRender and scene.registerAfterRender as an alternative to using animation objects. Simple example http://babylonjsguide.github.io/gamelets/Car_Path Animation frames are given a frame rate in frames per second and the BabylonJS engine draws the appropriate animation frame at the appropriate time. So if you give an animation a animation frame rate of 25 then after 500 seconds animation frame 20 will be draw during the correct scene frame rendering. So there are different ways of tackling animation within BJS and with care and careful planning and design much can be realised. Try out some ideas, modify other's work and most of all happy learning and game development. GameMonetize and jpdev 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.