|
![](/i/fill.gif) |
> 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
|
![](/i/fill.gif) |