POV-Ray : Newsgroups : povray.newusers : creating a surface from a matrix : Re: creating a surface from a matrix Server Time
4 Jul 2024 14:50:27 EDT (-0400)
  Re: creating a surface from a matrix  
From: Alain
Date: 30 Sep 2010 22:43:29
Message: <4ca54ad1$1@news.povray.org>

> Wow, thanks very much for the rapid response.
>
> I have a matrix XY grid and the data in each "square" describes a height, so
> your first idea should work well.
>
> However, my next issue is that I have 1000 of these matrices, so once I have
> set-up the POVRAY file, I wanted to create a shell script that would read the
> files (consecutively) in order to create 1000 individually images, which can be
> strung together as an animation.
>
> I'm not very good on POVRAY at the minute, but is this sort of thing possible,
> particularly bearing in mind that I need to convert them to first as you
> suggested????
>
> Thanks again
>
>

You can name all the files containing those matrixes with the same base 
name plus an ordinal number: Name0001.dat or Name0001.bmp for example.

Unce it's done and you have your SDL working, you can use the animation 
feature and read the files in sequance. You only need to concatenate the 
frame_number to the file's name and you are good to go.
concat("Name", str(frame_number,-4,0)),".dat")

"Name" is the base file's name.
str() convert a number into a string of text.
frame_number in an internal fariable containing the number of the 
current frame in an animation. Contains zero if not in an animation, 1 
or more in an animation.
"-4" ask for 4 digits padding to the left with zeros.
"0" ask for no decimal and no decimal point.
Change ".dat" to the actual extention you use.



Alain


Post a reply to this message

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