POV-Ray : Newsgroups : povray.animations : Tracking animation 'state' Server Time
23 Nov 2024 21:51:50 EST (-0500)
  Tracking animation 'state' (Message 1 to 3 of 3)  
From: Ross Del Duca
Subject: Tracking animation 'state'
Date: 9 Jun 2004 00:58:03
Message: <40c698da@news.povray.org>
I've created a model of flapping wings.  There are ribs, with bicubic
patches forming the 'skin' between the wings.  The wings are generated with
a macro that takes "spread" and "flap" values to determine their position -
which can in turn be based on the clock.

What I'm trying to add now is a way to have the 'skin' stretch as if
experiencing wind resistance.  To do that - I need someway to know the
motion of the wing (i.e. up or down) but I'm stumped about how to do this
since each frame is rendered individually.  Is there an easy way for me to
track what the last frame rendered was, so that I can then determine which
way to stretch the bicubic patch?

Thanks all!


Post a reply to this message

From: apollofencer22
Subject: Re: Tracking animation 'state'
Date: 22 Jul 2004 22:35:00
Message: <web.410078f973091c272c1235ad0@news.povray.org>
Ross Del Duca <ros### [at] delducagroupnet> wrote:
> I've created a model of flapping wings.  There are ribs, with bicubic
> patches forming the 'skin' between the wings.  The wings are generated with
> a macro that takes "spread" and "flap" values to determine their position -
> which can in turn be based on the clock.
>
> What I'm trying to add now is a way to have the 'skin' stretch as if
> experiencing wind resistance.  To do that - I need someway to know the
> motion of the wing (i.e. up or down) but I'm stumped about how to do this
> since each frame is rendered individually.  Is there an easy way for me to
> track what the last frame rendered was, so that I can then determine which
> way to stretch the bicubic patch?
>
> Thanks all!

Hey Ross-
Create a text file in the same folder as your .pov.
Use the #fopen statement with #read to get the value in the text file, and
with a #if statement check the previous wing position, then do with it what
you need to. Then at the end of your code #fopen and #write the new value
you want for the next frame.
example: (right in povray)
#declare wing_position = 0;
 #fopen MyFile1 "wings.txt" read
  #read (MyFile1, wing_position)
 #fclose MyFile1

 #if (wing_position = 1) // open
   // do something
   #declare next_position = 0;
 #else // closed
   // do something else
   #declare next_position = 1;
 #end

// povray code

#fopen MyFile1 "wings.txt" write
  #write (MyFile1, next_position)
 #fclose MyFile1
// this will make every other frame have an "open" or "closed" value


Post a reply to this message

From: Christian Kollross
Subject: Re: Tracking animation 'state'
Date: 7 Oct 2004 11:36:31
Message: <4165627f$1@news.povray.org>
Or you just calculate the wing's state for the previous frame and substract
this from the value of the present frame. This even gives you an idea about
how fast the wing is moving...


Post a reply to this message

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