POV-Ray : Newsgroups : povray.animations : Need help fast! Server Time
29 Jun 2024 00:55:56 EDT (-0400)
  Need help fast! (Message 1 to 4 of 4)  
From: Borodog
Subject: Need help fast!
Date: 24 Feb 2005 13:25:00
Message: <web.421e1adf3a10b8eeca937fd00@news.povray.org>
Hi all. I haven't used POVRay in several years, and now I find myself in the
position of needing help fast.

I teach physics at the North Carolina School of Science and Math, and have
some students working on a project concerning the physics of snowboarding.
They've created a model that simulates a downhill snowboard run, saving the
data in a plain text file containing x and y position, angle of attack of
the board, and direction of motion for successive timesteps.

I've created a POVRay source file of a snowboarder on an incline, and know
how to modify the source file to rotate and translate the character.
However, I need to know how to take the data generated by the simulation
and somehow plug it into the POVRay scene file and make a series of
rendered images and stitch them together and make an animation.

I did this sort of thing 5 or 6 years ago, but I was using an entirely
different platform, and it's been a long, long time. Can anyone give me the
quickest and dirtiest way to take our dataset and produce an animation?
Time is very short.

For what it's worth, we're running on Windows XP.

Thanks for any help you can provide.

Dr. Michael Owen
mow### [at] ncrrcom


Post a reply to this message

From: Mike Williams
Subject: Re: Need help fast!
Date: 24 Feb 2005 16:04:58
Message: <ET0SbAAzFkHCFwqA@econym.demon.co.uk>
Wasn't it Borodog who wrote:
>Hi all. I haven't used POVRay in several years, and now I find myself in the
>position of needing help fast.
>
>I teach physics at the North Carolina School of Science and Math, and have
>some students working on a project concerning the physics of snowboarding.
>They've created a model that simulates a downhill snowboard run, saving the
>data in a plain text file containing x and y position, angle of attack of
>the board, and direction of motion for successive timesteps.
>
>I've created a POVRay source file of a snowboarder on an incline, and know
>how to modify the source file to rotate and translate the character.
>However, I need to know how to take the data generated by the simulation
>and somehow plug it into the POVRay scene file and make a series of
>rendered images and stitch them together and make an animation.
>
>I did this sort of thing 5 or 6 years ago, but I was using an entirely
>different platform, and it's been a long, long time. Can anyone give me the
>quickest and dirtiest way to take our dataset and produce an animation?
>Time is very short.
>
>For what it's worth, we're running on Windows XP.
>
>Thanks for any help you can provide.

Convert your data to a format where the numbers are separated by commas,
ensuring that there is a comma at the ends of the lines. (POV doesn't
see the end of line characters, so it always needs the commas.)

1,2,3,0.5,
2,3,4,0.6,
3,4,5,0.7,

Then use POV to read the data with #fopen and #read, like this

#fopen DATA "data.txt" read     // open the file
#declare F=0;                   // start a counter
#while (F < frame_number)       // loop
  #read (DATA, X,Y,Z,Angle)     // read a chunk of data
  #declare F=F+1;               // increment counter
#end

POV restarts from the beginning of the file for each frame, so this code
reads and ignore the entries that correspond to earlier frames.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Borodog
Subject: Re: Need help fast!
Date: 25 Feb 2005 13:25:00
Message: <web.421f6cde2e505a1ca937fd00@news.povray.org>
Thank you, Mike. I eventually dug around enough in some example scene files
and the manual and came up with almost the same solution:

  #fopen Dataset "fort.23" read
  #declare Index = 1;
  #while(Index <= frame_number)
  #read (Dataset,Time,X_Pos,Y_Pos,Beta,Phi)
  #local Index = Index + 1;
  #end
  #fclose Dataset

But I really appreciate the response. The other part that was difficult was
getting it to actually animate, i.e. render more than one frame. This is
NOT adequately covered in the manual, in my humble opinion.

Thanks for your help,

Mike Owen

Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it Borodog who wrote:
> >Hi all. I haven't used POVRay in several years, and now I find myself in the
> >position of needing help fast.
> >
> >I teach physics at the North Carolina School of Science and Math, and have
> >some students working on a project concerning the physics of snowboarding.
> >They've created a model that simulates a downhill snowboard run, saving the
> >data in a plain text file containing x and y position, angle of attack of
> >the board, and direction of motion for successive timesteps.
> >
> >I've created a POVRay source file of a snowboarder on an incline, and know
> >how to modify the source file to rotate and translate the character.
> >However, I need to know how to take the data generated by the simulation
> >and somehow plug it into the POVRay scene file and make a series of
> >rendered images and stitch them together and make an animation.
> >
> >I did this sort of thing 5 or 6 years ago, but I was using an entirely
> >different platform, and it's been a long, long time. Can anyone give me the
> >quickest and dirtiest way to take our dataset and produce an animation?
> >Time is very short.
> >
> >For what it's worth, we're running on Windows XP.
> >
> >Thanks for any help you can provide.
>
> Convert your data to a format where the numbers are separated by commas,
> ensuring that there is a comma at the ends of the lines. (POV doesn't
> see the end of line characters, so it always needs the commas.)
>
> 1,2,3,0.5,
> 2,3,4,0.6,
> 3,4,5,0.7,
>
> Then use POV to read the data with #fopen and #read, like this
>
> #fopen DATA "data.txt" read     // open the file
> #declare F=0;                   // start a counter
> #while (F < frame_number)       // loop
>   #read (DATA, X,Y,Z,Angle)     // read a chunk of data
>   #declare F=F+1;               // increment counter
> #end
>
> POV restarts from the beginning of the file for each frame, so this code
> reads and ignore the entries that correspond to earlier frames.
>
> --
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

From: Slime
Subject: Re: Need help fast!
Date: 25 Feb 2005 13:37:05
Message: <421f7051@news.povray.org>
> But I really appreciate the response. The other part that was difficult
was
> getting it to actually animate, i.e. render more than one frame. This is
> NOT adequately covered in the manual, in my humble opinion.

Did you see section "2.3.8  Making Animations"? It seems to cover it pretty
thoroughly and I found it just now by typing "animation" into the index tab
of Windows Help.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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