POV-ray脚本只用黑色渲染

时间:2015-05-30 11:28:24

标签: render povray

有些POV-ray脚本只是给我一个空白的黑屏,而其他人运行正常。下面是一个例子(最初由史蒂夫沃特曼写的),这个场景只给我一个空白的黑屏

/*
mecon
*/


#declare a = 0.5;

union { 
polygon { 4,
 <1,  0, -a >,   < 1, -a,  0 >,   < 1,  0,  a >,   < 1,  a,  0 > }
polygon { 4,
 <-1, -a,  0>,   < -1,  0,  a>,   < -1,  a,  0>,   <-1,  0, -a > }
polygon { 4,
 < 0,  a, -1>,   < -a,  0, -1>,   <  0 ,-a ,-1>,   <  a , 0, -1> } 
polygon { 4,
 <-a , 0,  1>,   <  0,-a  ,1>,   < a,  0 , 1>,   <  0 , a , 1 > }
polygon { 4,
 < a , 1 , 0>,   <  0,  1,  a>,   < -a , 1 , 0 >,   < 0 , 1, -a > }
polygon { 4,
 <0, -1 , a >,   <-a,-1 , 0>,   <  0 ,-1, -a>,   < a ,-1 , 0 > }
polygon { 6,
 <-a,  0 , 1>,   <  0, -a , 1>,   <  0 ,-1 , a>,   <-a, -1 , 0>,   < -1, -a , 0>,   < -1 , 0 , a > }
polygon { 6,
 <-a , 0 , 1>,   < -1 , 0 , a>,   < -1 , a  ,0 >,   <-a , 1 , 0 >,   < 0 , 1 , a >,   < 0 , a , 1> } 
polygon { 6, 
 <0 , a , 1  >,   <0 , 1 , a >,   < a  ,1 , 0 >,   < 1 , a , 0 >,   < 1 , 0 , a >,   < a  ,0 , 1 > }
polygon { 6,                          
 <a , 0 , 1 >,   < 1 , 0 , a>,   <  1 ,-a , 0>,   <  a, -1  ,0 >,   < 0 ,-1 , a >,   <0 ,-a  ,1 > }
polygon { 6,
 <-a , 0 ,-1>,   <  0 ,-a ,-1>,   <  0 ,-1 ,-a >,   <-a, -1 , 0 >,   <-1, -a ,0 >,   <-1  ,0 ,-a > }
polygon { 6,
 <-a , 0 ,-1>,   < -1  ,0 ,-a>,   < -1 , a , 0>,   < -a , 1 , 0>,   <  0 , 1,-a>,   <  0  ,a,-1 > }
polygon { 6,
  <0 , a ,-1>,   <  0 , 1 ,-a >,   < a , 1 , 0>,   < 1 , a , 0>,   < 1 , 0, -a >,   < a , 0, -1 > }
polygon { 6,
  <a  ,0 ,-1 >,   < 1, 0 ,-a >,   < 1, -a , 0>,   <  a ,-1 , 0 >,   < 0, -1, -a >,   < 0 ,-a ,-1 > }

}  

虽然以下代码完美无缺......

/* Change this at will */
#declare ROOT = 10;

/* This varies the colour ramp, should be between 0 and 1 */
#declare CUTOFF = 0.5;

#declare RADIUS2 = 2 * ROOT;
#declare RADIUS = sqrt(RADIUS2);
#declare SRADIUS = 1/sqrt(2.0);

#declare vp = 0.7*<3*(RADIUS+0.5),(RADIUS+0.5),(RADIUS+0.5)>;
camera {
   location vp
   up y
   right -x*image_width/image_height
   angle 60
   sky <0,0,1>
   look_at <0,0,0>
}

global_settings {
  assumed_gamma 1.0
}

light_source {
   <3*RADIUS,RADIUS,2*RADIUS>
   color rgb <1,1,1>
}

#declare IR = int(RADIUS2+1);
#declare ix = -IR;
#while (ix <= IR) 
   #declare iy = -IR;
   #declare R = ix*ix + iy*iy;
   #while (iy <= IR)
      #declare iz = -IR;
      #while (iz <= IR)
         #if (mod(ix+iy+iz,2) = 0)
            #declare R = ix*ix + iy*iy + iz*iz;
            #if (R <= RADIUS2)
               #debug "o"
               sphere {
                  <ix,iy,iz>, SRADIUS
                  #declare RAMP = (R-CUTOFF*RADIUS2)/(RADIUS2-CUTOFF*RADIUS2);
                  #if (RAMP > 1)
                     #declare RAMP = 1;
                  #end
                  #if (RAMP < 0)
                     #declare RAMP = 0;
                  #end
                  texture {
                     pigment { color rgb <RAMP,0,1-RAMP> }
                     finish { specular 0.3 }
                  }
               }
            #end
         #end
         #declare iz = iz + 1;
      #end
      #declare iy = iy + 1;
   #end
   #declare ix = ix + 1;
#end

我正在x64 Win&amp; amp;上使用POV-ray 3.7机。

我是POV-ray的新手,我应该知道任何隐藏的设置?

基于以下评论的附加说明:

我添加了一个相机&amp;光源如下..

#declare vp = 0.7*<3*(a+0.5),(a+0.5),(a+0.5)>; 
camera {
   location vp
   up y
   right -x*image_width/image_height
   angle 60
   sky <0,0,1>
   look_at <0,0,0>
}   

light_source {
   <3*a,a,2*a>
   color rgb <1,1,1>
}

global_settings {
  assumed_gamma 1.0
}

......但我仍然是一个空白的屏幕。

0 个答案:

没有答案