POV-Ray : Newsgroups : povray.binaries.animations : Re: crash walking (731k divx) Server Time
19 Jul 2024 19:21:37 EDT (-0400)
  Re: crash walking (731k divx) (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Sebastian H 
Subject: Re: crash walking (731k divx)
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

From: Simon Adameit
Subject: Re: crash walking (731k divx)
Date: 6 Aug 2002 16:42:10
Message: <3d5034a2@news.povray.org>
"Rune" wrote:
> My own experiments on the other hand have been minded more towards being
> able to create animations from inside POV-Ray. My biggest problem is
> that I haven't found a method to deform a mesh to follow a set of
> bones... :(

What is your problem?  To get the mesh data into format that can be used
with POV's file io? You could write an external utility to do that. Or
deforming the mesh data? I want to know because I'm really intrested in
animating meshes with POV-Ray.

Simon


Post a reply to this message

From: Sebastian H 
Subject: Re: crash walking (731k divx)
Date: 6 Aug 2002 16:53:06
Message: <3D5037D7.9020109@web.de>
> 
> I agree. It looks nice. :)
> 

Thanks :-)


> I agree it's very well done, but I'd like to point out that the things
> I'm working on are of a bit different kind I think.
> 
> Sebastian, if I understand correctly, is working on converting and
> interpolating model data and animation data already created with
> external utilities. Creating an animation from scratch will still
> require you to have that utility that is used to create the animation
> data.

Thats right, the actual work has to be done somewhere else :-(

> My own experiments on the other hand have been minded more towards being
> able to create animations from inside POV-Ray. My biggest problem is
> that I haven't found a method to deform a mesh to follow a set of
> bones... :(
> If I could do that, it would be possible to use any mesh, and animate it
> from inside POV-Ray, but I haven't had any success on that yet...
> 

Thats a very interesting idea!!!

There was a similar problem when trying to glue the crash model 
together. It consits of three parts, head, torso and legs. They all have 
so called "tags", on these there can be attached other models so it's a 
kind of "three bone" system.

I think the Pov-language with it's limitations will make it a mess to 
create a more complex bonetree. There is a lack of structures like the 
c++ "class" or "struct" which one can fill with data, access by it's 
type or link anyhow. Maybe there's a workaround...

Regards,
Sebastian H.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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