POV-Ray : Newsgroups : povray.animations : skeletal animation using POV-RAY : Re: skeletal animation using POV-RAY Server Time
19 May 2024 02:23:13 EDT (-0400)
  Re: skeletal animation using POV-RAY  
From: Chris B
Date: 2 Feb 2008 06:49:15
Message: <47a458bb@news.povray.org>
"melo" <mel### [at] coxnet> wrote in message 
news:web.47a3eb67e148a5763c0d56f20@news.povray.org...
>I am new to POV-RAY and animation, I have managed to create a H-ANIM 
>complaint
> CSG based pov-ray Humanoid model and managed to provide AVARs (Animation 
> control
> variables) to define control frame poses,  POV-RAY does animate each frame
> wonderfully on its own.
>

Hi Melo,

It's very brave to start with human animation as this is normally something 
of an advanced topic.
I hope you mean you're new to animation with POV-Ray and not new to both 
animation and POV-Ray. Otherwise you may find the learning curve a bit 
steep.
The wording you've used below is not totally clear to me, so forgive me if 
I've misunderstood anything;

> I had placed each of my control frames in its own block using multi-stage
> animation setup.
>
> What's missing is figuring out how to tie my frames smoothly.  Each pose 
> in each
> frame involve quite a number of joint object (represented by spheres) 
> rotations
> to take place.  The next frame needs to start off where the previous frame 
> left
> off.  What I see instead my humanoid jumping all over the screen from 
> stage to
> stage.
>

If I understand your code sample below correctly you already have a variable 
defined for the default position of each object - effectively an anatomical 
definition, based upon the default pose for H-Anim forms -  and a variable 
for each individual joint rotation (the pose). Presumably the unions in your 
CSG correspond to the anatomy so that successive rotations correctly adjust 
the ultimate position and orientation of any body parts that are affected by 
a succession of rotations by virtue of the fact that they are connected to 
other moving parts.

If I understand your problem correctly you need some way of calculating 
intermediary sets of joint rotations so that you can engineer a smooth 
transition from one pose to another;

> Is there a way to query coordinates of my AVAR joint objects from a nested 
> CSG
> Object, which is what my Humanoid is, so I can transform my Humanoid to 
> where
> the previous movements had left him at the beginning of the each new 
> stage?
>

I think what you're asking is to be able to do is to make a macro call from 
within the CSG definition that will look up two values for the same 
variable, from different pose files, and return an intermediary set of 
rotations. Conceptually it is possible and I can think of a number of 
approaches, but they all get pretty messy given the way your variables are 
defined. So you could have one macro per joint that reads one pose file, 
copies the required value into a temporary variable then reads the other 
pose file and returns the results of processing the two values, but this is 
extremely cumbersome and involves a lot of unnecessary IO. You could have a 
single macro and pass it some indication of which variable you want, but 
this is difficult and will also get very messy very quickly.

The approach I took for POV-Person was to assign all of the rotations to an 
array, recording the array index into a variable with a real-world joint 
name, so I could access an individual rotation as 
JointRotations[L_Elbow_Ref], but it also meant that I could process the 
whole array by using a #while loop to loop through the array elements. To 
calculate intemediary poses I then used a macro to:
1. read one pose file
2. copy all elements into a temporary array
3. read a second pose file
4. copy all elements into a second temporary array
5. calculate the intermediary rotations (based on the desired interpolation 
methods -  linear, sinusoidal etc.) and write them back into the main array 
which the SDL could subsequently use to create the figure.

This only had to process the two pose files once and could be run before 
building the CSG. From within the CSG you could then access the individual 
rotations using the 'JointRotations[L_Elbow_Ref]' notation.

> After he walks he can learn TaiChi and Yoga with me.
>

There are already quite a few BVH files about, so he may be able to learn 
quicker than you. :-)

> This is too much detail but the variable name declared for one joint 
> object
> center is like
>
> #declare JOC_l_elbow = <a, b, c>; // These are from H-ANIM ISO standard
> #declare JOC_l_wrist = <d, e, f>;
>
> #declare joint_radius_arm = 0.3; // These are some values I picked
>
> #declare l_elbow_ctl = <x, y, z>; // a rotation control vector  All my 
> AVARs
>                            // have _ctl suffix, for an example I show one 
> here.
>
> then in my Humanoid CSG definition is something like
>
> #declare Humanoid =
> Union {
>  sphere{
>  cone{..
>  union{
>    sphere{
>    cone{
>    sphere{
>    cone{
>    union{
>      sphere{ JOC_l_elbow, joint_radius_arm }
>      cone{ JOC_l_elbow, joint_radius_arm, JOC_l_wrist, 0.0 }
>      #if ( VZero(r_elbow_ctl) )
>      #else
>         Rotate_Around_Trans( rl_elbow_ctl, JOC_l_elbow )
>         //Rotate_Around_Trans( l_elbow_ctl, vtransform( JOC_l_elbow,
> Human_Trans ) )
>      #end
>     }
>      }
>    }
>  };
>

I hope I've understood your question correctly and that the answer helps in 
some way.

Regards,
Chris B.


Post a reply to this message

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