POV-Ray : Newsgroups : povray.binaries.animations : Re: crash walking (731k divx) : Re: crash walking (731k divx) Server Time
19 Jul 2024 21:36:28 EDT (-0400)
  Re: crash walking (731k divx)  
From: Sebastian H 
Date: 6 Aug 2002 15:57:22
Message: <3D502AC6.8040904@web.de>
Hugo schrieb:
>>I tried to convert the animation data as well.
>>(By the way it used Pov's spline function to interpolate the
>>meshframes, great stuff!)
> 
> 
> Now THAT is interesting! Do you think it could work on a dense polygon
> shape? I can imagine it's relative easy to isolate the vertices in a
> low-poly shape and animate them (maybe all vertices simply get a new value
> from your file, for each frame?)

The interpolation is quite easy:
Every animation (here it's the "walk" animation) consits of several 
keyframes which it runs through.
A keyframe holds the information of every vertex of the model (and the 
tags but they're just vectors, too).
Now you have the animation time and you know the time difference between 
the keyframes:

...4....5....6....7....8....9....10....11...
            A
            | Animation time is here between keyframe 5 and 6

The vertices are stored in an array, to do the interpolation you load 
the keyframes 1,2,3 and 4.
For every Vertex you create a cubic spline through these four
keypositions and read it's value at the specific time.

Some Pseudocode:
(vv means vertex vector)
vv_X is an array that holds all vertices where X is the number of the 
Keyframe and cvar is the number of the current vertex.

#declare S=
   spline {
     cubic_spline
     -1.0, vv_4[cvar]
      0.0, vv_5[cvar]
      1.0, vv_6[cvar]
      2.0, vv_7[cvar]
   }
In the example the time is 3/5 on the way between keyframe 5 and 6 so 
you get your interpolated vertex vector from the spline with:

#local interpolated_vertex_vector = (S(3/5));

All this is done by a macro which you only have to give the frame 
numbers and the time difference to (this one is wrapped by an other 
macro...) so it works with every animation.

 From an include file:
#macro md3_cub_int (FRAME0, FRAME1, FRAME2, FRAME3, DIF)
.
.
#end
(md3 is the name of the modelformat Quake3 uses)

> 
> If you could make it work with a selection of key-vertices, interpolated
> with the rest of polygons, I'd say here goes the next "Rune" ... hehe, I
> mean, you're playing on a high level, then.  :o)
> 

Hmm this is nothing special. It's a common way to use different spline 
types for vertex interpolation. But thanks! ;-)

Oh now I get it! You mean to interpolate the polygons to increase the 
triangle resolution of the shape. Shouldn't be that difficult, could be 
done with the normal vector....
Some hardware OpenGL implemetations do this if I remeber right and 
wasn't there someone who did it for the pov smooth triangle?


Regards,
Sebastian


Post a reply to this message

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