导图社区 pov-ray
这是一篇关于pov-ray的思维导图,pov-ray是一款使用光线跟踪绘制三维图形的开源软件,该思维导图全面且系统地展示了其相关知识和使用方法,主要内容包括:基础,图形,颜色,光源阴影,坐标变换,材质贴图,立体演算,背景,循环处理。
编辑于2026-01-06 14:56:50pov-ray
基础
基本构造
//导包 #include "colors.inc" #include "shapes.inc" //摄像机 camera{ location <5,3,5>//摄像机位置<x,y,z>轴坐标 look_at <0,0,0>//摄像机看的方向 angle 30//摄像机视野角度,数字越大范围越广,物体越小 } //光源 light_source{<10,5,5> color White} //对象 object{ sphere{<0,0,0>,1} pigment{color Orange} }
坐标轴

图形
球
 object{ sphere{<0,0,0>,1}//形状,中心坐标,半径 pigment{color Orange}//颜色 }
立方体
 object{ box{<0,0,0>,<1,1,2>}//形状,对角点坐标 pigment{color Orange}//颜色 }
圆柱
 object{ cylinder{<0,0,0>,<0,1,0>,0.5}//形状,下地面,上底面,半径 pigment{color Orange}//颜色 }
圆锥,圆台
 object{ cone{<0,0,0>,0.5,<0,1,0>,0.2}//形状,下地面,下底面半径,上底面,上底面半径 //其中一个半径为0则为圆锥 pigment{color Orange}//颜色 }
圆环
 object{ torus{1,0.2}//形状,半径,断面半径(默认在0,0,0的位置创建) pigment{color Orange}//颜色 }
无限平面
 object{ plane{<0,1,0>,-1}//形状 ,垂直Y轴,平面到原点的距离 pigment{color Orange}//颜色 }
颜色
颜色名指定

RGB颜色指定

透明化
pigment{color Orange transmit 0.5}//指定0到1间的透明度1为完全透明 pigment{rgbt <0,1,1,0.7>}//指定0到1间的透明度1为完全透明
类型颜色指定
棋盘 sphere
 object{ sphere{<0,0,0>,1}//形状,中心坐标,半径 pigment{checker color White, color Green}//类型颜色类型,颜色1,颜色2 //pigment{checker rgb <0,1,0>, rgb<1,0,0>}//类型颜色类型,颜色1,颜色2 }
砖块 brick
 object{ box{<-5,-5,-5>,<5,5,5>} pigment{brick color White, color Green}//类型颜色类型,颜色1,颜色2 //pigment{brick rgb <0,1,0>, rgb<1,0,0>}//类型颜色类型,颜色1,颜色2 }
六角形 hexagon
 object{ cylinder{<0,-3,18>,<0,3,18>,6} pigment{hexagon color White, color Green}//类型颜色类型,颜色1,颜色2 //pigment{hexagon rgb <0,1,0>, rgb<1,0,0>}//类型颜色类型,颜色1,颜色2 }
光源阴影
点光源
//light_source{<90,90,30> color White*2} light_source{<90,90,30> rgb<1,1,1>*2}
面光源
/*light_source{ <90,90,30>color White*2 area_light <15,0,0>,<0,0,15>//长方形平行光原位置 5,5 //纵横光源数 jitter } */ light_source{ <90,90,30> rgb <1,1,1>*2 area_light <15,0,0>,<0,0,15> 5,5 jitter }
可以同时设定多个光源
聚光灯
 #include "colors.inc" #include "shapes.inc" camera{ location <20,10,0> look_at <0,0,0> angle 30 } light_source{<5,10,0>color White*2 //点光源位置 spotlight point_at <0,0,0>//照射位置 radius 10//强调半径 falloff 15//照射半径 } object{ sphere{<0,0,0>,1} pigment{color Orange} } object{ plane{y,-3} pigment{color Plum} }
去除阴影
 //light_source{<90,90,30> color White*2 shadowless} light_source{<90,90,30> rgb<1,1,1>*2 shadowless}
坐标变换
移动 translate
 #include "colors.inc" #include "shapes.inc" camera{ location <10,5,0> look_at <0,0,0> angle 40 } light_source{<20,10,0> color White*2 } //light_source{<90,90,30> rgb<1,1,1>*2 shadowless} object{ sphere{<0,0,0>,0.5} pigment{color Orange} } object{ sphere{<0,0,0>,0.5} pigment{color Red} translate <0,2,0> } object{ sphere{<0,0,0>,0.5} pigment{color Pink} translate <0,-2,0> }
旋转 rotate
 #include "colors.inc" #include "shapes.inc" camera{ location <10,5,0> look_at <0,0,0> angle 40 } light_source{<20,10,0> color White*2 } //light_source{<90,90,30> rgb<1,1,1>*2 shadowless} object{ cone{<0,0,0>,0,<0,0,3>,0.3} pigment{color Orange} } object{ cone{<0,0,0>,0,<0,0,3>,0.3} pigment{color Red} rotate <0,90,0> } object{ cone{<0,0,0>,0,<0,0,3>,0.3} pigment{color Pink} rotate <0,-90,0> }
扩大缩小 scale
 #include "colors.inc" #include "shapes.inc" camera{ location <10,5,0> look_at <0,0,0> angle 40 } light_source{<20,10,0> color White*2 } object{ sphere{<0,0,0>,0.5} pigment{color Orange} } object{ sphere{<0,2,0>,0.5} pigment{color Red} scale <1,1,1.5> } object{ sphere{<0,-3,0>,0.5} pigment{color Pink} scale <0.5,0.5,0.5> }
坐标变换组合
 #include "colors.inc" #include "shapes.inc" camera{ location <0,10,0> look_at <0,0,0> angle 40 } light_source{<0,30,0> color White*2 } object{ sphere{<0,0,0>,0.3} pigment{color Orange} translate <0,0,2> //z方向移动2 } object{ sphere{<0,0,0>,0.3} pigment{color Orange} translate <0,0,2> rotate <0,30,0> //旋转30度 } object{ sphere{<0,0,0>,0.3} pigment{color Orange} translate <0,0,2> rotate <0,60,0> } object{ sphere{<0,0,0>,0.3} pigment{color Orange} translate <0,0,2> rotate <0,90,0> }
材质贴图
材质
 #include "colors.inc" #include "shapes.inc" #include "textures.inc" //导包 camera{ location <5,3,5> look_at <0,0,0> angle 30 } light_source{<10,5,5> color White*2 } object{ sphere{<0,0,0>,1} texture{DMFWood1} //使用材质 }
常用材质贴图
基本素材 textures
 
石材 stones

木材 woods

玻璃 glass 金属 metals
 
天空 skies
 
星空 stars
 
纹理
 #include "shapes.inc" #include "textures.inc" //导包 camera{ location <5,3,5> look_at <0,0,0> angle 30 } light_source{<10,5,5> color White*2 } object{ sphere{<0,0,0>,1} pigment{color Orange} normal{agate 0.9} //使出现纹理 ,0到1的区间 数值越大凹凸越深 }
贴图
 #include "colors.inc" #include "shapes.inc" camera{ location <5,3,5> look_at <0,0,0> angle 30 } light_source{<10,5,5> color White*2 } object{ sphere{<0,0,0>,1} pigment{ image_map{jpeg "pic.jpg" map_type 0} //使用贴图图片需要下载放在作业文件目录 } }
立体演算
结合 union
 #include "colors.inc" #include "shapes.inc" camera { location <10,5,0> look_at <0,0,0> angle 30 } light_source {<10,5,5> color rgb <1,1,1> * 2.5 shadowless} union { object { sphere {<0,0,0>, 1.0} pigment {rgbt <1,1,0,0.5>} } object { cylinder {<0,-1.5,0>, <0,1.5,0>, 0.5} pigment {rgbt <1,0,1,0.5>} } }
交差 intersection
 #include "colors.inc" #include "shapes.inc" camera { location <10,5,0> look_at <0,0,0> angle 30 } light_source {<10,5,5> color rgb <1,1,1> * 2.5 shadowless} intersection { //保留重合部分 object { sphere {<0,0,0>, 1.0} pigment {rgbt <1,1,0,0.5>} } object { cylinder {<0,-1.5,0>, <0,1.5,0>, 0.5} pigment {rgbt <1,0,1,0.5>} } }
差 difference
 #include "colors.inc" #include "shapes.inc" camera { location <10,5,0> look_at <0,0,0> angle 30 } light_source {<10,5,5> color rgb <1,1,1> * 2.5 shadowless} difference { //用对象1-对象2 object { //对象1 sphere {<0,0,0>, 1.0} pigment {rgbt <1,1,0,0.5>} } object { //对象2 cylinder {<0,-1.5,0>, <0,1.5,0>, 0.5} pigment {rgbt <1,0,1,0.5>} } }
合并 merge
 #include "colors.inc" #include "shapes.inc" camera { location <10,5,0> look_at <0,0,0> angle 30 } light_source {<10,5,5> color rgb <1,1,1> * 2.5 shadowless} merge{ //对象1和对象2合并成一个物体 object { //对象1 sphere {<0,0,0>, 1.0} pigment {rgbt <1,1,0,0.5>} } object { //对象2 cylinder {<0,-1.5,0>, <0,1.5,0>, 0.5} pigment {rgbt <1,0,1,0.5>} } }
背景
背景色 background
 #include "colors.inc" #include "shapes.inc" #include "textures.inc" //导包 camera { location <0,0,10> look_at <0,0,0> angle 30 } light_source {<50,50,100> color White} object { sphere {<0,0,0>, 1.0} texture { Silver_Metal normal {bumps 0.5 scale 0.03} } } background {color SkyBlue} //天空色的背景
背景透明化
  #include "colors.inc" #include "shapes.inc" #include "textures.inc" //导包 camera { location <0,0,10> look_at <0,0,0> angle 30 } light_source {<50,50,100> color White} object { sphere {<0,0,0>, 1.0} texture { Silver_Metal normal {bumps 0.5 scale 0.03} } } background {color Red transmit 1} //背景颜色为透明
地形
 #include "colors.inc" #include "shapes.inc" #include "textures.inc" //导包 camera { location <5,1,10> look_at <0,1,0> angle 45 } light_source {<10,40,90> color White} background{color SkyBlue} object{ //水面 Plane_XZ texture{Water scale <2,0.1,2> translate 10*z} } object{ //地面 Plane_XZ rotate 2*x pigment{color Goldenrod} normal{wrinkles 1 scale 0.5 turbulence 0.5} } object { //地形山 height_field{png "Mount1.png" smooth}//自带的素材 scale <400,30,400> translate <-200,0,-450> pigment{color Gray} normal{crackle 2 scale <5,15,5> turbulence 0.5} }
天空
 #include "colors.inc" #include "shapes.inc" #include "skies.inc" //导包 camera { location <0,1,10> look_at <0,3,0> angle 45 } light_source {<100,50,50> color White} object{ //地面 Plane_XZ pigment{color ForestGreen} normal{bumps 1 scale 0.01} } sky_sphere{S_Cloud1} //天空
宇宙
 #include "shapes.inc" #include "stars.inc" //导包 camera { location <0,0,10> look_at <1,0.5,0> angle 30 } object{Sphere scale 10000 hollow texture{Starfield2}}
循环处理
单循环
 #include "colors.inc" #include "shapes.inc" camera { location <50,0,0> look_at <0,0,0> angle 40 } light_source{<30,0,0> color White*2} #declare i=0; #while(i<10) object{ sphere{<0,-10,-10>,1} pigment{color Orange} translate<0,2*i,2*i> } #declare i=i+1; #end
多循环
 #include "colors.inc" #include "shapes.inc" camera { location <50,0,0> look_at <0,0,0> angle 40 } light_source{<30,0,0> color White*2} #declare i=0; #while(i<8) #declare j=0; #while(j<5) object{ sphere{<0,-10,-10>,1} pigment{color Orange} translate<0,3*i,5*j> } #declare j=j+1; #end #declare i=i+1; #end