Results 1 to 5 of 5

Thread: 2d animation

  1. #1

    2d animation

    Hi all,
    I'm investigating the possibility to implement some sort of advanced animation in a game. I'm looking to achieve the same effect as the character in the game LIMBO. Would some sort of IK algorithm need to be implemented to simulate the movement of the head and limbs? I cannot imagine that some sort of a sprite based approach is used. So how would that work in a real life game? Do you need to create a walk/jump/grab cycle and is there some smooth interpolation between the different states? Is IK then used in other cases? Or is the movement of the cycles only described for a minimal set of "nodes" and does IK calculate the position of the remaining nodes? (although this seems to be very impractical)
    I would be very thankful if someone could offer some example code or a library that can help me move further on this. So far there seems to be very little available that is usable on the internet. Can anyone explain in simple steps how to code a walk cycle? I know how to create one in let's say blender, but how does this get implemented in a game? Can anyone share their workflow?

    Regards, Darius

  2. #2
    There is something called 2d skeletal animation. Here is a site (http://kaliko.com/blog/2d-skeletal-animation-tools/) that links three tools that does exactly what you want, for Flash/Action Script 3, there is no Pascal equivalent yet. One of them has a file format that can be used anywhere if you know how.

    Edit: I totally forgot about this thread http://www.pascalgamedevelopment.com...s-(and-Source)
    Last edited by pitfiend; 21-07-2014 at 10:22 PM.

  3. #3
    Hi Darius,

    This kind of animation is time framed : Skeleton and geometric propagation (linear transformation an so on).
    A good point to begin : The Spine
    http://esotericsoftware.com
    You will find "runtime" Pascal engine for the file product by spine here : http://esotericsoftware.com/spine-in-depth#Runtimes
    Cheers,

    P.s. : The Pascal Runtime has been writen by Dan.
    http://www.pascalgamedevelopment.com/member.php?564-Dan
    Last edited by Vinzvega; 22-07-2014 at 01:08 PM.

  4. #4
    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);

  5. #5
    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
  •