46

Animations in which the character translates away from the origin are said to contain "Root Motion" - because the root bone moves. This allows the animator to directly author subtle non-uniformities in the movement speed, in a "what you see is what you get" fashion. Say the character slows down slightly as their foot makes contact with ...


14

As far as I know, this is because the humans centre of mass is near the pelvis. This is just a convention, but almost everyone does it. But it makes sense to choose a point that is at the middle (not a foot for example) and doesn't move too much. Let's say you choose the foot as root. If you want to do a walk animation, you'll move the foot and everything ...


6

This will work if all you're concerned about is the translation part of each bone, but it is more common to represent your bone structure as a transformation matrix tree, which is probably the most popular way to do Forward Kinematics. Define a Node as follows: class Node { Transform localTransform; Node parent; List<Node> children; /...


6

To get a transformation matrix equivalent to the one you have, but reflected across a major axis you can compose it (multiply it by) a reflection matrix. That is, if you have your input matrix M and you multiply by a matrix N that has the reflection. To create the reflection matrix based on the major axis, you take the identity matrix and flip signs ...


5

If you were using assimp's implementation (AssimpViewer source) as reference, then you probably too missed the fact that Assimp's and glm use reverse matrix multiplication order. To clarify, we are talking about matrix-matrix multiplication, and the order is reverse relative to each other And we know that matrix multiplication is not commutative. So the ...


5

Keep in mind I had this problem over 2 years ago and I have since moved onto Unity 3D. This is more of a conclusion than a solution. The main problem was that moving the bones did not move the mesh. I used Cinema 4D to model and rig the model and exported as fbx. There are many fbx export options in C4D and I tried many variants with no success. Here are ...


4

If you want your character's look to change uniformly (i.e. at any time, all sprites are at the same point of transition between states), the simplest way I can think of is to create them as separate skins in Spine. The Unity runtime tfor Spine then lets you render the skeleton with either skin, so you can control the transparency by rendering each skin once,...


4

OK, after much button mashing, I figured it out: If you click on your main FBX object, in the inspector you will find 3 buttons at the top. The ones we care about are Rig and Animations. If you go to Rig and drop down the "Root node" selector, then choose your root bone, it will open up some more options under the Animations button. Go back to the ...


4

Small clipping errors are almost impossible to avoid when developing games, as self collision with large amounts of animated characters are very costly to calculate. If you need (almost) perfect animations for cutscenes, animate each character on its own. But when you are animating for realtime, you should not worry about minor errors, as these are barely ...


4

Note that this is the 38th tutorial in a series. If you go back to part 22, you can see m_Entries is defined as follows: The m_Entries member of the Mesh class is a vector of the MeshEntry struct where each structure corresponds to one mesh structure in the aiScene object. That structure contains the vertex buffer, index buffer and the index of the ...


4

A technique which comes around again and again for decades is raytracing. While usual 3d engines are based on taking a bunch of vertices in 3d space and see where they end up if transformed to 2d space through a projection matrix, raytracing engines simulate a ray of light from each screen-pixel into the scene and see where it hits a surface. Raytracing ...


4

To throw out one other possibility, we can define a scene in terms of a signed distance field and raymarch against that. Many demoscene creations use this technique to create highly detailed scenes on a minuscule data budget, letting the mathematical formulae do the heavy lifting. This scene, from a demo called rgba slisesix was created by Íñigo Quilez, one ...


3

You can still have the same single mesh just with different bones matrices (prepared for different animation frames of meshes instances) and do the transformations in shader. For that you need to decouple mesh from animated bones. So that you can still redraw same mesh several times, just changing the meshes position AND bones matrices between drawcalls. ...


3

I have founded the solution: https://www.youtube.com/watch?v=xf0VD4ba4ns In this video's desc link shows a file that I used to the new code wich is working


3

There is actually a doll for exactly this purpose: It appears to be under development by SoftEther Corporation. However, I imagine such a solution might be overkill. An alternative would be to use a GI Joe for your modeling. Record video of your GI Joe manipulations from the front, side and top. Using these synced videos, you can go frame by frame ...


3

Ok i found the problem. It came down to my misconception of when to call glBindAttribLocation. Changes made with glBindAttribLocation will only take effect after calling glLinkProgram. It hadn't been a problem before but in this particular case it got me. For those on the same rocky path as me i found that the shadows of my animated models were scaled wrong....


3

All of my issues boiled down to misusing the model's index array. At first I purposely avoided using the model's indices because I wanted to have per vertex normals rather than per face normals. However, I completely forgot that the vertex list may not correspond to the correct rendering order, which lead to the results in my opening post. On my way to ...


3

You should not multiply by delta time here: float newRotation = verticalMovement * m_AimAmount * m_DeltaTime; Multiplication by delta time is useful when you're accumulating an incremental movement each frame, so the total movement builds at a consistent rate even if your frames are uneven durations. But that's not what you're doing here. Here, every ...


2

It's the transformation between the bone's local space and the whole mesh's object space. In other words, it goes from a coordinate system that has its origin at the joint location and its axes aligned with the bone, to the coordinate system for the whole mesh. (Or maybe it goes the other direction, depending on how it's defined exactly.) This is ...


2

I figured out how to fix this, but I'm still not entirely positive what the actual problem was. My rotation was very simple and was only in the X axis. The Y and Z axis remained at 0 throughout the rotation. However, if I manually type 0 into these boxes (even though they are already 0) the weird rotation problem goes away. This is repeatable. If I don'...


2

This seems like an optimization question. As such the answer, as always is to profile it. If generating the matrices doesn't take too much time on the fly, then it is simply easier to do on the fly, as you don't have to write and export/import of matrices, and add it to your file format. And perhaps you could simply use other file formats natively and not ...


2

The animation of skinned characters is usually performed using vertex shader constants. The model matrix is usually ignored, or used to define the local-to-world of the entire bone rig. Each bone is uploaded into a fixed, known constant offset. That same offset is cooked into the vertex data so that each vertex can extract the correct shader constant. In ...


2

First thing I see is that you shouldn't read the quaternion in reverse order. Also you shouldn't use glm::mix, use glm::slerp instead. And here is how I construct the bone transform: mat = glm::mat4_cast( currentrotation ); mat[0][0] *= currentscale.x; mat[1][0] *= currentscale.x; mat[2][0] *= currentscale.x; mat[0][1] *= currentscale.y; mat[1][1] *= ...


2

Read this through and my best guess is that there is something wrong here: root->finalMatrix = root->animationMatrix * root->offsetMatrix; How is offsetMatrix calculated? And what is it supposed to do (I know somekind of offset). Would also like to see these calculations: //rotation glm::mat4 R = ... //calculate rotation matrix based on time //...


2

Solved: I had to negate the w component of the rotation quaternion on both the bind pose bones and the animation frame bones.


2

No. Your 3D model MUST have bones of some kind in order to tell the game engine how it should move. Bones also include optional scripts, ik chains, etc., in order to tell it how to move around. Think of it in real life - without bones your body could not move at all. Same concept here. :D


2

Though there were a few vertices attached to the IK bones, the problem eventually proved to be that some vertices were not weighed to any bone at all. For reasons relating to the implementation of UE4, the mesh and skeleton are placed facing down and the bones placed the vertices to their appropriate position during animation playback, thus the vertices not ...


2

If you are working with DirectX 10 or higher, you can do stream-output. The Idea is, that you keep a vertex buffer of the unskinned mesh, run it through a stream-output shader which is a vertex shader + geometry shader combo. In that shader you can do your skinning, and stream it out to an other Buffer, which you can bind like a regular vertex buffer later. ...


2

IK Rig looks very cool, and from what I can find, it's all in the name. It's about using Inverse Kinematics, prescribing the bare minimum number of elements for describing an animation -- feet, pelvis, wrists, shoulders, neck-base and head. Everything in between is constrained according to artistic factors and calculated in-engine, or baked to a new, more ...


Only top voted, non community-wiki answers of a minimum length are eligible