- V := VertexPosition;
- For x := 0 to NumOfBones do
- If Bone Effects Vertex then
- V := V + (Bone * Weight);
DGL https://delphigl.com/forum/ |
|
Blending Matrices https://delphigl.com/forum/viewtopic.php?f=19&t=4098 |
Seite 1 von 1 |
Autor: | McCLaw [ Di Mai 03, 2005 19:40 ] |
Betreff des Beitrags: | Blending Matrices |
Hi All I am in the process of implementing a Bone Blending animation class, but I have hit a math snag. I have gotten to the point of getting all the interpolated matrices from the active animations, but I am unsure how to change them according to the weight of each animation, and then how to merge them. PS: My math knowledge sucks, so speak to me like i'm a three year old ![]() Any ideas will be greatly appreciated |
Autor: | Stucuk [ Mi Mai 04, 2005 16:12 ] |
Betreff des Beitrags: | |
If i remember MD5's correct u add all the bones positions to the vertex's that it effects with the weight scale thing applyed to the bones position. Code:
|
Autor: | AL [ Mi Mai 04, 2005 23:25 ] |
Betreff des Beitrags: | |
Nearly. In the MD5 format you need to do 2 things: First calc the skeleton. Usually there are lots of frames, so you actually don't need any interpolation. However, looks like you somehow managed to do that. Than you have to go through the whole skeleton, and multiply the matrices to get the world-space-matrix of each node. (Dunno, whether you already got that part). Second thing to do is what Stucuk mentioned: Code:
This is more or less what I did for MD5s. Worked for most of the models... |
Autor: | McCLaw [ Do Mai 05, 2005 22:51 ] |
Betreff des Beitrags: | |
Thanx for the suggestions ![]() I figured out a way of doing this with Nitrogens help (Thanx Dude) ![]() Code:
Obviously this in only the first part of the process, I stil need to add individual bone weights into the algo to allow for feather blending. The current code basically allows any number of interpolated frames in several animations to be blended by their influence (Value between 0 and 1) I had a look at doing all the calculations per vertex, but that seemed way too expensive.(My thoughts: Rather do a 16 * amount of bones calculation then an undefined number of calculations for any number of vertices in the mesh) and then just apply the resulting matrix to the correct verts in the inverted mesh. It seems that the same theory would apply to individual bone weights, but I'll only know once I have finished that ![]() PS: I'm using the VectorGeometry.pas file from glscene. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |