POV-Ray : Newsgroups : povray.unofficial.patches : Mesh2 Boning suggestion : Mesh2 Boning suggestion Server Time
8 Jul 2024 17:10:17 EDT (-0400)
  Mesh2 Boning suggestion  
From: Rune
Date: 30 Sep 2001 06:10:08
Message: <3bb6ef80@news.povray.org>
Currently it's practically impossible to animate detailed characters in
POV-Ray efficiently.

I propose an addition to the mesh2 object that will allow a mesh2 object to
be "boned".
The idea is to apply different transformations to different parts of the
mesh.
This way you could have a character where the torso is aligned with one
transformation,
the thigh with another transformation, the shin with a third and so on.

Generation of those transformation could be done in any way transformations
can normally be created, for example using a custom include file. So forward
kinematics, inverse kinematics and all kinds of animation systems could be
created in POV-Script, which would output transformations which are used by
the mesh2 object.

In order to get smooth bending some parts of the mesh should be transformed
not by one transformation, but by a weighted average of several
transformations.
The extension I propose is to add three new blocks to the mesh2 object. They
are of course optional, but if you use them, you must specify all three.
They are: transform_indices{}, transform_combinations{}, transform_list{}.

Here is the proposed syntax:

transform_indices
      {
        number_of_faces,
        <combination_a, combination_b, combination_c>,
        <combination_d, combination_e, combination_f>,
        ...
      }

transform_combinations
      {
        number_of_combinations,
        {index_a},
        {index_b, weight1},
        {index_c, weight2, index_d, weight3},
        {index_e, weight4, index_f, weight5, index_g, weight6 ...},
        ...
      }

transform_list
      {
        number_of_transformations,
        transform { Transform1 },
        transform { Transform2 },
        ...
      }


transform_list is a list of transformations, semewhat similar to the
texture_list block.

transform_combinations is a bit special. Each combination is wrapped in { },
as it can contain any number of items. The items in a combination are pairs
of indices to transformations, and weights for those transformations. The
number of items must be even, except if there is only one index specified,
in which case the weight can be left out and will default to 1.0.

transform_indices are a list of indices that points to the combinations. It
is somewhat similar to the normal_indices.

A average of several transforms is calculated this way:
A matrix can describe any transformation, so I'll use that to explain it.
matrix <a,b,c, d,e,f, g,h,i, j,k,l>
let's call a,b,c for X, d,e,f for Y, g,h,i for Z and j,k,l for P.
The averaged transformation 3 is the averaged of the transformations 1 and
2:
P3 is simply a weighted average of P1 and P2.
X3 is the weighted average of vnormalize(X1) and vnormalize(X2) multiplied
with the weighted average of vlength(X1) and vlength(X2).
Y3 and Z3 is calculated like X3. The method also works for a weighted
average of more than two transformations.

I suggest that if the weights specified in a combination do not add up to
1.0, then they're *not* corrected. There may be situations where it can be
useful to add transformations together. Who knows? Better not to make an
unnecessary limitation.

Any way, what do you think of this proposed feature?
Do you see any problems with it?
Are anyone willing to program it?

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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