您还没有登陆到CGPAD.COM   现在登录   注册新用户
搜索 CGPAD.COM
 
 
 
张友邦    尘世如潮人如水 只叹江湖几人回
 http://span.cgpad.com
 
 
   空间首页  生活日记  原创作品  博客文章  共享资源  新闻网摘  我的收藏  社区活动  博客留言   进入后台
 
 
POV-Ray的一个简单造型(附源代码)
分类:分形艺术   发表:2008-09-18 11:11:55   点击:1734   回复:1

下面是源代码:

#version 3.6;
global_settings { assumed_gamma 1.0 }


#include "colors.inc"
#include "textures.inc"
camera {location  < 0 , 0 ,-8.0>
        look_at   < 0.0, 0.0,  0.0>}

light_source{<1800,2500,-2500> color White}


#declare Ball = 
 sphere  {<0,0,0>,0.2
 texture{pigment{color rgb<1,0.60,0.0>}
         finish {ambient 0.05 diffuse 0.95 phong 1}}}


#local __number_of_spheres = 500;
#local __iter = 0;

#local __x = 0;
#local __y = 0;
#local __r = 1.0;
#local __theta = 0.0;
#local __scale = 1.0;
#local __inverse = 1;

union {
#while (__iter < __number_of_spheres)
  #local __r = __r * (1.0 - (1.0 / __number_of_spheres));
  #local __x = __r * cos(__theta);
  #local __y = __r * sin(__theta);
  
  #if (__inverse > 0)
    #local __inverse = -1;
    object{
      Ball
      translate <__x, __y, 0>
      scale __scale * cos(__theta) * sin(__theta)
      
      pigment{color Green}
    }
  #else
    #local __inverse = 1;
    object{
      Ball
      translate <__x, __y, 0>
      scale __scale * cos(__theta) * sin(__theta)
      
      pigment{color Yellow}
    }
  #end
  
  #local __theta = __theta + 20.0 / __number_of_spheres;
  #local __scale = __scale * (1.0 - (1.0 / __number_of_spheres));
  #declare __iter = __iter + 1;
#end

scale 8
}


标签:
 
附件:
 
声明:CGPAD文章版权属于作者,受法律保护。没有作者书面许可不得转载。
 
评论或跟帖
 

#1 wujiaping (佳) 2010-01-21 00:44:22

不好意思,我现在在做关于POV-Ray的作业,你可不可以解释一下,这个小作品的原理,我有点看不到这个源码的意思。拜托你了。

可以的话,请详细点!!

 
 
 
版权所有 © 2005-2008 CGPAD.COM,湘ICP备07500998号,兼容浏览器:IE6IE7FireFoxOperaSafariChrome
Total Requests: 4862130, Total Visits: 2764179, Processing Time: 46ms,