Results 1 to 5 of 5

Thread: 2d animation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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);

  2. #2
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    This is the Tutorial I used to figure out the basic Idea hope it helps
    http://content.gpwiki.org/index.php/...ic_Bone_System

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •