POV-Ray : Newsgroups : povray.binaries.images : confusion about multiple images output Server Time
1 Nov 2024 00:25:34 EDT (-0400)
  confusion about multiple images output (Message 1 to 3 of 3)  
From: CAS
Subject: confusion about multiple images output
Date: 4 Sep 2014 11:15:01
Message: <web.540880efc0fb48076a92a3a00@news.povray.org>
I am so sorry to disturb you again.But I want to ask a new problem.
I want to read 127 scene reflectivity files, 127 scene coordinate files (the
position of scene has unchanged, so the 127 scene coordinate files is only),My
whole code and data have been uploaded,the code about loop to read files are
below:

#declare spec_file_name_array=array[127]{
"1.txt","2.txt","3.txt","4.txt","5.txt","6.txt","7.txt","8.txt","9.txt","10.txt",
"11.txt","12.txt","13.txt","14.txt","15.txt","16.txt","17.txt","18.txt","19.txt","20.txt",
"21.txt","22.txt","23.txt","24.txt","25.txt","26.txt","27.txt","28.txt","29.txt","30.txt",
"31.txt","32.txt","33.txt","34.txt","35.txt","36.txt","37.txt","38.txt","39.txt","40.txt",
"41.txt","42.txt","43.txt","44.txt","45.txt","46.txt","47.txt","48.txt","49.txt","50.txt",
"51.txt","52.txt","53.txt","54.txt","55.txt","56.txt","57.txt","58.txt","59.txt","60.txt",
"61.txt","62.txt","63.txt","64.txt","65.txt","66.txt","67.txt","68.txt","69.txt","70.txt",
"71.txt","72.txt","73.txt","74.txt","75.txt","76.txt","77.txt","78.txt","79.txt","80.txt",
"81.txt","82.txt","83.txt","84.txt","85.txt","86.txt","87.txt","88.txt","89.txt","90.txt",
"91.txt","92.txt","93.txt","94.txt","95.txt","96.txt","97.txt","98.txt","99.txt","100.txt",
"101.txt","102.txt","103.txt","104.txt","105.txt","106.txt","107.txt","108.txt","109.txt","110.txt",
"111.txt","112.txt","113.txt","114.txt","115.txt","116.txt","117.txt","118.txt","119.txt","120.txt",
"121.txt","122.txt","123.txt","124.txt","125.txt","126.txt","127.txt"};

#declare i = 1;
#while(i<127)
#declare spec_file_name=spec_file_name_array[i];
#declare n = 0;
#fopen   Input_geom_file geom_file_name read
#fopen   Input_spec_file spec_file_name read
#while(defined(Input_geom_file))
#while(defined(Input_spec_file))
    #read(Input_geom_file,x1,y1,z1)
    #read(Input_spec_file,ref)

 box
        {
        -1.55,1.55
        rotate y*-31
        translate<x1-689344.9877,y1-435,z1-5200131.542>
        pigment{color rgb 1}
        finish {
              ambient 0
              emission 0
              diffuse ref
              }
         }
#declare n = n + 1;
#while(n>40000)
#end
#end
#declare i=i+1;
#end
#debug concat(str(n,15,2),"\n")

My question is :my desired output should be 127 different pictures, but
according to my uploaded codes,I found the 127 outputs are the same. I doublt my
loop is wrong.Pov did not read 127 files,and read just only one file to cycle
127 times.This have confused me a long time.I beg a help.Thank you!


Post a reply to this message

From: Le Forgeron
Subject: Re: confusion about multiple images output
Date: 4 Sep 2014 11:46:42
Message: <54088962$1@news.povray.org>
On 04/09/2014 17:12, CAS wrote:
> I am so sorry to disturb you again.But I want to ask a new problem.
> I want to read 127 scene reflectivity files, 127 scene coordinate files (the
> position of scene has unchanged, so the 127 scene coordinate files is only),My
> whole code and data have been uploaded,the code about loop to read files are
> below:
> 
> #declare spec_file_name_array=array[127]{
> "1.txt","2.txt","3.txt","4.txt","5.txt","6.txt","7.txt","8.txt","9.txt","10.txt",
>
"11.txt","12.txt","13.txt","14.txt","15.txt","16.txt","17.txt","18.txt","19.txt","20.txt",
>
"21.txt","22.txt","23.txt","24.txt","25.txt","26.txt","27.txt","28.txt","29.txt","30.txt",
>
"31.txt","32.txt","33.txt","34.txt","35.txt","36.txt","37.txt","38.txt","39.txt","40.txt",
>
"41.txt","42.txt","43.txt","44.txt","45.txt","46.txt","47.txt","48.txt","49.txt","50.txt",
>
"51.txt","52.txt","53.txt","54.txt","55.txt","56.txt","57.txt","58.txt","59.txt","60.txt",
>
"61.txt","62.txt","63.txt","64.txt","65.txt","66.txt","67.txt","68.txt","69.txt","70.txt",
>
"71.txt","72.txt","73.txt","74.txt","75.txt","76.txt","77.txt","78.txt","79.txt","80.txt",
>
"81.txt","82.txt","83.txt","84.txt","85.txt","86.txt","87.txt","88.txt","89.txt","90.txt",
>
"91.txt","92.txt","93.txt","94.txt","95.txt","96.txt","97.txt","98.txt","99.txt","100.txt",
>
"101.txt","102.txt","103.txt","104.txt","105.txt","106.txt","107.txt","108.txt","109.txt","110.txt",
>
"111.txt","112.txt","113.txt","114.txt","115.txt","116.txt","117.txt","118.txt","119.txt","120.txt",
> "121.txt","122.txt","123.txt","124.txt","125.txt","126.txt","127.txt"};
> 
> #declare i = 1;
> #while(i<127)
> #declare spec_file_name=spec_file_name_array[i];
> #declare n = 0;
> #fopen   Input_geom_file geom_file_name read
> #fopen   Input_spec_file spec_file_name read
> #while(defined(Input_geom_file))
> #while(defined(Input_spec_file))
>     #read(Input_geom_file,x1,y1,z1)
>     #read(Input_spec_file,ref)
> 
>  box
>         {
>         -1.55,1.55
>         rotate y*-31
>         translate<x1-689344.9877,y1-435,z1-5200131.542>
>         pigment{color rgb 1}
>         finish {
>               ambient 0
>               emission 0
>               diffuse ref
>               }
>          }
> #declare n = n + 1;
> #while(n>40000)
> #end
> #end
> #declare i=i+1;
> #end
> #debug concat(str(n,15,2),"\n")
> 
> My question is :my desired output should be 127 different pictures, but
> according to my uploaded codes,I found the 127 outputs are the same. I doublt my
> loop is wrong.Pov did not read 127 files,and read just only one file to cycle
> 127 times.This have confused me a long time.I beg a help.Thank you!

Looks like a job for animation options!
povray .... +KI1 +KF127 +KFI1 +KFF127

and replace the #declare i=1;/#while(i<127) / #end with

#declare i = frame_number; /*(or clock) */

Files will be named foo001.png to foo127.png (assuming you output to png
format, and that scene file is foo.pov)

-- 
IQ of crossposters with FU: 100 / (number of groups)
IQ of crossposters without FU: 100 / (1 + number of groups)
IQ of multiposters: 100 / ( (number of groups) * (number of groups))


Post a reply to this message

From: Alain
Subject: Re: confusion about multiple images output
Date: 4 Sep 2014 16:41:58
Message: <5408ce96@news.povray.org>

> I am so sorry to disturb you again.But I want to ask a new problem.
> I want to read 127 scene reflectivity files, 127 scene coordinate files (the
> position of scene has unchanged, so the 127 scene coordinate files is only),My
> whole code and data have been uploaded,the code about loop to read files are
> below:
>
> #declare spec_file_name_array=array[127]{
> "1.txt","2.txt","3.txt","4.txt","5.txt","6.txt","7.txt","8.txt","9.txt","10.txt",
>
"11.txt","12.txt","13.txt","14.txt","15.txt","16.txt","17.txt","18.txt","19.txt","20.txt",
>
"21.txt","22.txt","23.txt","24.txt","25.txt","26.txt","27.txt","28.txt","29.txt","30.txt",
>
"31.txt","32.txt","33.txt","34.txt","35.txt","36.txt","37.txt","38.txt","39.txt","40.txt",
>
"41.txt","42.txt","43.txt","44.txt","45.txt","46.txt","47.txt","48.txt","49.txt","50.txt",
>
"51.txt","52.txt","53.txt","54.txt","55.txt","56.txt","57.txt","58.txt","59.txt","60.txt",
>
"61.txt","62.txt","63.txt","64.txt","65.txt","66.txt","67.txt","68.txt","69.txt","70.txt",
>
"71.txt","72.txt","73.txt","74.txt","75.txt","76.txt","77.txt","78.txt","79.txt","80.txt",
>
"81.txt","82.txt","83.txt","84.txt","85.txt","86.txt","87.txt","88.txt","89.txt","90.txt",
>
"91.txt","92.txt","93.txt","94.txt","95.txt","96.txt","97.txt","98.txt","99.txt","100.txt",
>
"101.txt","102.txt","103.txt","104.txt","105.txt","106.txt","107.txt","108.txt","109.txt","110.txt",
>
"111.txt","112.txt","113.txt","114.txt","115.txt","116.txt","117.txt","118.txt","119.txt","120.txt",
> "121.txt","122.txt","123.txt","124.txt","125.txt","126.txt","127.txt"};
>
> #declare i = 1;
> #while(i<127)
> #declare spec_file_name=spec_file_name_array[i];
> #declare n = 0;
> #fopen   Input_geom_file geom_file_name read
> #fopen   Input_spec_file spec_file_name read
> #while(defined(Input_geom_file))
> #while(defined(Input_spec_file))
>      #read(Input_geom_file,x1,y1,z1)
>      #read(Input_spec_file,ref)
>
>   box
>          {
>          -1.55,1.55
>          rotate y*-31
>          translate<x1-689344.9877,y1-435,z1-5200131.542>
>          pigment{color rgb 1}
>          finish {
>                ambient 0
>                emission 0
>                diffuse ref
>                }
>           }
> #declare n = n + 1;
> #while(n>40000)
> #end
> #end
> #declare i=i+1;
> #end
> #debug concat(str(n,15,2),"\n")
>
> My question is :my desired output should be 127 different pictures, but
> according to my uploaded codes,I found the 127 outputs are the same. I doublt my
> loop is wrong.Pov did not read 127 files,and read just only one file to cycle
> 127 times.This have confused me a long time.I beg a help.Thank you!
>
>

As it is now, you read each input files, but only render an image. Also, 
you now have 127 coincident copies of your boxes differing by the 
diffuse values.
Just take a look at the objects count. It's probably 127 times to large.

Render with +kff127
Replace your loop by:

#declare spec_file_name=spec_file_name_array[frame_number];
//#declare n = 0; "n" is never used
#fopen   Input_geom_file geom_file_name read
#fopen   Input_spec_file spec_file_name read
#while(defined(Input_geom_file))
//#while(defined(Input_spec_file)) Why?
// Use one of those loops, not both.
// The two files should have the same number of entries.
// If one files is sometimes shorter, test THAT file.

     #read(Input_geom_file,x1,y1,z1)
     #read(Input_spec_file,ref)

  box{
         -1.55,1.55
         rotate y*-31
         translate<x1-689344.9877,y1-435,z1-5200131.542>
         pigment{color rgb 1}
         finish {
               ambient 0
               emission 0
               diffuse ref
               }
          }
//#declare n = n + 1; Why?
//#while(n>40000) Very bad!
//#end If "n" ever get larger than 40000, it becomes an infinite loop
// Otherwise, it exits immediately.
#end



Alain


Post a reply to this message

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