POV-Ray : Newsgroups : povray.animations : Need help fast! : Re: Need help fast! Server Time
1 Jul 2024 04:48:34 EDT (-0400)
  Re: Need help fast!  
From: Mike Williams
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

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