POV-Ray : Newsgroups : povray.newusers : batch data output Server Time
23 Dec 2024 01:41:54 EST (-0500)
  batch data output (Message 1 to 4 of 4)  
From: Colaroid
Subject: batch data output
Date: 7 Oct 2010 10:30:00
Message: <web.4cadd8e914c5d93dc0abfa3e0@news.povray.org>
Hi all

Thanks to lots of help from you guys on here, I have now managed to write a
POVRAY file to read a greyscale tiff file and produce a height_field to
represent it in 3 dimensions.

I have written the following code:


 #include "colors.inc"
  camera {
        location <1, 2, -1.5>
    look_at <0.25, 0, 1>
    angle 30}

background { color Gray } // to make the torus easy to see

 light_source { <5, 8, -5> White}

height_field{
      tiff
      "map0001.tif"
         smooth
          texture{
          pigment{
               gradient y
               color_map{
                       [0.0 rgb <0.2,0,0>]
                       [0.5 rgb <0.5,0.2,0>]
                       [1.0 rgb <1,1,1>]
                        }
                 }
             finish{ambient .2 diffuse .8}
            }
                   scale <0,0.025,0>
       translate <0,0.5,0>
    }


I now wish to get POVRAY to automatically read a list of 1000 map####.tif files
(each one with a consecutive file number: i.e. map0001.tif, map0002.tif,
map0003.tif, etc, etc) to then produce 1000 map####.bmp files (POVRAY rendered,
of course!).

Alain has kindly given me the following code for concat, but I am now not 100 %
sure how to apply this to my POVRAY code to get me exactly what I want:

 concat("map", str(frame_number,-4,0)),".tif")

Please can somebody help me just to finish off this last bit of coding required?

Many thanks for all your help so far.

Colaroid


Post a reply to this message

From: Christian Froeschlin
Subject: Re: batch data output
Date: 7 Oct 2010 15:37:32
Message: <4cae217c$1@news.povray.org>
Colaroid wrote:

>  concat("map", str(frame_number,-4,0)),".tif")

Replace "map0001.tif" with the above code. Then render an
animation with 1000 frames (well better test with two first :-P)
using command line options +kfi 1 +kff 1000


Post a reply to this message

From: Alain
Subject: Re: batch data output
Date: 7 Oct 2010 15:38:03
Message: <4cae219b$1@news.povray.org>

> Hi all
>
> Thanks to lots of help from you guys on here, I have now managed to write a
> POVRAY file to read a greyscale tiff file and produce a height_field to
> represent it in 3 dimensions.
>
> I have written the following code:
>
>
>   #include "colors.inc"
>    camera {
>          location<1, 2, -1.5>
>      look_at<0.25, 0, 1>
>      angle 30}
>
> background { color Gray } // to make the torus easy to see
>
>   light_source {<5, 8, -5>  White}
>
> height_field{
>        tiff
>        "map0001.tif"
>           smooth
>            texture{
>            pigment{
>                 gradient y
>                 color_map{
>                         [0.0 rgb<0.2,0,0>]
>                         [0.5 rgb<0.5,0.2,0>]
>                         [1.0 rgb<1,1,1>]
>                          }
>                   }
>               finish{ambient .2 diffuse .8}
>              }
>                     scale<0,0.025,0>
>         translate<0,0.5,0>
>      }
>
>
> I now wish to get POVRAY to automatically read a list of 1000 map####.tif files
> (each one with a consecutive file number: i.e. map0001.tif, map0002.tif,
> map0003.tif, etc, etc) to then produce 1000 map####.bmp files (POVRAY rendered,
> of course!).
>
> Alain has kindly given me the following code for concat, but I am now not 100 %
> sure how to apply this to my POVRAY code to get me exactly what I want:
>
>   concat("map", str(frame_number,-4,0)),".tif")
>
> Please can somebody help me just to finish off this last bit of coding required?
>
> Many thanks for all your help so far.
>
> Colaroid
>
>
When you use that in an amimation, the internal variable "frame_number" 
contains a value representing the number of the current frame been rendered.

If you use it in place of the ordinary file's name, then, for each 
frame, POV-Ray will read the corresponding source image.
Sample code:

[begining of your code]
height_field{
       tiff
       concat("map", str(frame_number,-4,0)),".tif")
          smooth
[rest of your code]

Then, on the command line, you put "+kff1000" to invoque the animation loop.
Under windows and I think mac OS, the command line is the text box next 
to the resolutions list.

The output images will be named scene0001, scene0002,... with an 
extention according to the file format you chosed for the output.

If you want to test outside of an animation, you'll need a file named 
map0000.tif or use:
tiff
  #if(frame_number = 0)
   "map0001.tif"
#else
   concat("map", str(frame_number,-4,0)),".tif")
#end
smooth

This will use your first image for testing outside an animation.




Alain


Post a reply to this message

From: Colaroid
Subject: Re: batch data output
Date: 8 Oct 2010 10:05:01
Message: <web.4caf2467d6f47d33c0abfa3e0@news.povray.org>
That's amazing, it works perfectly!!!!

Thank you very very much for your help throughout this, I really appreciate it.

Cheers


Post a reply to this message

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