Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
1.0.0:custommesh [2023/03/23 13:50] – [Add Animation] admin1.0.0:custommesh [2023/03/23 13:59] – [Add a Skin-Animation] admin
Line 328: Line 328:
  
  
-=== Vertex Groups ===+=== How To Use Vertex Groups ===
  
 VertexGroups are helper structures referring to an owner mesh, which holds original vertex data and complete indices list, while this structure only holds a separated index source for partially rendering a mesh. VertexGroups are helper structures referring to an owner mesh, which holds original vertex data and complete indices list, while this structure only holds a separated index source for partially rendering a mesh.
Line 352: Line 352:
 end; end;
 </file> </file>
-=== Add Material ===+=== Add Material ===
  
 To expand the dynamic model setup, let's add a material to our sub-mesh. To expand the dynamic model setup, let's add a material to our sub-mesh.
Line 381: Line 381:
 </file> </file>
  
-=== Add Animation ===+=== Add A Simple Animation ===
  
 Adding animations can become a very challenging part due to complexity. Adding animations can become a very challenging part due to complexity.
Line 433: Line 433:
  
  
-==== Add Armature & SkinController ====+=== Add Armature & SkinController ===
  
 To make skin- or skeleton-animations possible you will need an armature with a hierarchy of joints representing the internal skeleton of a body. To make skin- or skeleton-animations possible you will need an armature with a hierarchy of joints representing the internal skeleton of a body.
Line 490: Line 490:
   LCtrl.Skin.Skeletons.Add(LJtRef);   LCtrl.Skin.Skeletons.Add(LJtRef);
  
-  // We have to link all relevant joint to the skin and add weights and joint-indices+  // We have to link all relevant joint to the skin and add weights and vertex-indices 
 +  // "Weights" and "Indices" arrays has to have the same size. 
 +  // The sum of all weights (over all joints) for a specific vertex has to be 1.0!
   LJtRef := LCtrl.Skin.LinkJoint(Result.Root);   LJtRef := LCtrl.Skin.LinkJoint(Result.Root);
   LJtRef.Weights := [0.75, 0.75, 0.75, 0.75, 0.25, 0.25, 0.25, 0.25, 0, 0, 0, 0];   LJtRef.Weights := [0.75, 0.75, 0.75, 0.75, 0.25, 0.25, 0.25, 0.25, 0, 0, 0, 0];
Line 518: Line 520:
 </file> </file>
  
-To animate the armature and it's necessary to have compatible animation stages and interpolators.+=== Add a Skin-Animation ===
  
-Regarding our skin-animation example, the code could look something like this:+To animate the armature it's necessary to have compatible animation stages and interpolators. 
 + 
 +Related to our armature and bones (joints) before, the code could look something like this:
  
 <file pascal> <file pascal>
Line 604: Line 608:
 __NOTICE:__ You will need a stage for each joint to be modified during the animation. __NOTICE:__ You will need a stage for each joint to be modified during the animation.
  
-==== Create FMX Components from Definition ====+=== Create FMX Components from Definition ===
  
 <file pascal> <file pascal>