With OpenGL it is at least a fairly short code to achieve joint behavior. Some kind of pseudo-code:
Code:
character.Transform;
Torso.Transform;
Torso.Render;
PushState;
Head.Transform;
Head.Render;
PopState;
PushState;
LeftShoulder.Transform;
LeftShoulder.Render;
LeftArm.Transform;
LeftArm.Render;
...
PopState
...
RightShoulder...
LeftThigh...
RightThigh...
In basics that's it, but you are better off try make the character in some editor so that you can do the same in a general form
Code:
procedure Render(const node: TJoint);
var i: integer;
begin
glPushMatrix;
node.Transform;
node.Render;
for i:=0 to node.Count-1 do
Render(node.child[i]);
glPopMatrix;
end;
Render(character.root);
Bookmarks