POV-Ray : Newsgroups : povray.animations : IK Skeleton : Re: IK Skeleton Server Time
19 Apr 2024 09:56:54 EDT (-0400)
  Re: IK Skeleton  
From: trp
Date: 5 May 2012 11:50:01
Message: <web.4fa54bf5d487aa7a23227c740@news.povray.org>
Hi Guys.

I've been reading your discussions and you got me thinking. I have looked at
reconstructing Blobman to use in my Alive! program. But, it occurred to me
yesterday that it might be easier to just create a translation link file. I
already have a stick figure I animate in Alive! I wrote the following this
morning:

          ----------------

//*****
// Temporarily move arms out of the way for testing.
//*****
#local BM_RA_S2E=<90,90,-8>; // Right Shoulder
#local BM_RA_E2W=<90,90,-3>; // Right Elbow
#local BM_LA_S2E=<90,-90,8>; // Left Shoulder
#local BM_LA_E2W=<90,-90,3>; // Left Elbow


//*****
// Link the Joints angles from Alive! to Blobman
//*****

// Right Hip
#ifdef (Rhip_R)
  #local BM_RL_H2K=<8,0,-5>;             // Set to Blobman default
                                         // Add Alive! action angle
  #local BM_RL_H2K=BM_RL_H2K + <-Rhip_R.x,Rhip_R.y,Rhip_R.z>;
  #local BM_RL_H2K=BM_RL_H2K - <0,0,45>; // Subtract Alive! default angle
#else
  #local BM_RL_H2K=<8,0,-5>;             // Started at the hip. Need to complete
the linkage to the base.
#end


// Right Knee
#ifdef (RKnee_R)
  #local BM_RL_K2A=<-8,0,3>;              // Set to Blobman default
  #local BM_RL_K2A=BM_RL_K2A + BM_RL_H2K; // Add angles of preceeding joints
                                          // Add Alive! action angle
  #local BM_RL_K2A=BM_RL_K2A + <-RKnee_R.x,RKnee_R.y,RKnee_R.z>;
  #local BM_RL_K2A=BM_RL_K2A - <0,0,0>;   // Subtract Alive! default angle
#else
  #local BM_RL_K2A=<-8,0,3> + BM_RL_H2K;  // Set to Blobman default plus
preceeding joint angles
#end


// Right Ankle
#ifdef (RAnkle_R)
  #local BM_RF_Rot=<8,0,-3>;
                                          // Add Alive! action angle
  #local BM_RF_Rot=BM_RF_Rot + <-(RAnkle_R.x+180),RAnkle_R.y,RAnkle_R.z>;
  #local BM_RF_Rot=BM_RF_Rot - <-90,0,0>; // Subtract Alive! default angle
#else
  #local BM_RF_Rot=<8,0,-3>;
#end


// Left Hip
#ifdef (LHip_R)
  #local BM_LL_H2K=<8,0,5>;              // Set to Blobman default
                                         // Add Alive! action angle
  #local BM_LL_H2K=BM_LL_H2K + <-LHip_R.x,LHip_R.y,LHip_R.z>;
  #local BM_LL_H2K=BM_LL_H2K - <0,0,-45>;// Subtract Alive! default angle
#else
  #local BM_LL_H2K=<8,0,5>;              // Started at the hip. Need to complete
the linkage to the base.
#end


// Left Knee
#ifdef (LKnee_R)
  #local BM_LL_K2A=<-8,0,-3>;             // Set to Blobman default
  #local BM_LL_K2A=BM_LL_K2A + BM_LL_H2K; // Add angles of preceeding joints
                                          // Add Alive! action angle
  #local BM_LL_K2A=BM_LL_K2A + <-LKnee_R.x,LKnee_R.y,LKnee_R.z>;
  #local BM_LL_K2A=BM_LL_K2A - <0,0,0>;   // Subtract Alive! default angle
#else
  #local BM_LL_K2A=<-8,0,-3> + BM_LL_H2K; // Set to Blobman default plus
preceeding joint angles
#end


// Left Ankle
#ifdef (LAnkle_R)
  #local BM_LF_Rot=<8,0,3>;
                                          // Add Alive! action angle
  #local BM_LF_Rot=BM_LF_Rot + <-(LAnkle_R.x+180),LAnkle_R.y,LAnkle_R.z>;
  #local BM_LF_Rot=BM_LF_Rot - <-90,0,0>; // Subtract Alive! default angle
#else
  #local BM_RF_Rot=<8,0,3>;
#end

//*****
// Include the Blobman
//*****
#include "bmpeople.inc"
Blob_Man(Male,2)
object {BlobMan transform BMO_Abdomen_U scale 35 rotate Unknown_ROT1 rotate
Unknown_ROT2 rotate Unknown_ROT3 translate <0,30,0>}

          --------------------

As you have seen, Blobman orients each limb separately rather then chaining off
of the proceeding limb. This include file (while quick and dirty and only
dealing with the legs at present) accounts for that and applies my LKnee_R
vector to Blobman's left knee adjusting for the preceeding adjustment to the
hip. I included this file in my character and used the walk cycle from lesson 3
of my documentation and got this:

http://www.imagicproductions.com/Example/Animation21.gif

It is not perfect. But, I was pleased with 2 hours of playing around. I left the
stick figure legs in to show how it translated.

Maybe everyone else has already thought of this. But, I'm happy to have a way to
incorporate Blobman and POVpeople without as much work as I thought. If you
haven't thought of it, maybe it would help with your packages.

I should also be able to use the existing Costume Definition Files.  :)

TRP


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.