ParaToxic Posted October 10, 2012 Share Posted October 10, 2012 Hei guys I have a question.In my game I would like to have a character from the first person view ( so you can see the body from the head position ) and now I have a question to that.When I want to animate for example a pistol for the relode, shoot and so one I can't make millions of animations for the character that he is walk and shoot, run and shoot, walk and relode...... So my idea was , that in LE you can load the animations from file and I would like to divide the character to some parts like the legs, the spine area ( the upper body part) and the arms.Then I can have 3 animations for the legs like idle/walk/run and soone for the upper body part and can make my weapon specific animations only for t he arms. Is that the right way to do that or is that possible to use 3 skeletons for one body ??? ( Do I have to divide the skleleton to my needed parts or use the whole skeleton and animate only the part I use ?? ) Thank you Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted October 10, 2012 Share Posted October 10, 2012 To answer your question I will first explain how the animation works. In a single frame you call animate on a model or mesh, now the mesh itself is not "animated perse" but rather the bones of the mesh are. The mesh then is deformed to those bones via the use of the skin shader. To do this the Animate() function actually sets the animation for the specified entity and all of its children. This is how all the bones are animated even though you only animate the model or mesh. So basically the Animate() function animates the entity specified and all of its children. Now if you think of it bones have a hierarchy as well so if you call Animate() on a single bone entity, only that bone and its children will be animated. Therefore, you need to use split animations and call Animate() on different bones separately in the hierarchy. Now what you do, say if you want to animate someone running and shooting and running and reloading then you need to do a few things. 1. Animate the whole model in the run animation, 2. Use FindChild() to get the hip bone (or what ever bone's children are the upper body) <- You'll want to do this on initialize instead of every frame and store the bone in an LE::TEntity. 3. Call animate on the hip bone (or whatever it is), except animate it for aiming. ----- most of the time you can end here but it can be much more detailed if you want as continues ---- 4. Use FindChilde() to get the forearm bone <-- once again done at initialize instead of every update 5. Call animate on the forearm bones except animate for reloading... or shooting or whatever instead of running. This method will combine the animations and it's pretty much how it is done in all games. Therefore, you can get a tonne of animations from actually just animating a few: eg. Your base animations are: - Idle - Running - Walking - Aiming - Reloading - Shooting - Bashing and you simply combine those in the code to make more eg. Idle Idle + aiming Idle + aiming + shooting Idle + aiming + reloading run run + aiming run + aiming + reloading etc.etc.etc. Hope that makes sense Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
ParaToxic Posted October 10, 2012 Author Share Posted October 10, 2012 Okey thanks.But one question is open. When I want to animate only the legs, do I have to use the full skeleton and animate only the legs or do I have to cut the skeleton and use only the legs ??? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 10, 2012 Share Posted October 10, 2012 http://www.leadwerks.com/werkspace/page/Documentation/le2/_/tutorials/introduction-to-animation-r474 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
ParaToxic Posted October 10, 2012 Author Share Posted October 10, 2012 Thanks 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.