博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
povray[2] = 大地
阅读量:7167 次
发布时间:2019-06-29

本文共 2611 字,大约阅读时间需要 8 分钟。

在「」一节中,草率的用了一张棋盘格图案的平面当作大地。现在,我们将它做成草地:

plane {  y, 0  texture {    pigment {      color rgb<0.35,0.65,0.0>*0.8    }    normal {      bumps 1.25       scale 0.015    }  }}

草地,是通过让绿色的平面随机的产生一些小的凹凸而营造的一种假象:

lawn

也就是说,平面还是平面,只是平面上蒙上了一层草地的图案。草地的图案,是通过 bumps 语句随机扰动平面的法向而渲染出来的。可以尝试不同的 bumpsscale 的参数,理解它们对草地图案渲染结果的影响。

不过,现在的场景依然很不真实。天际不应该是那么蓝,地平线也不应该那么清晰。即使去了西藏,天际顶多也只是淡蓝色的。我们需要用雾气消除这种不真实:

fog {   fog_type   2  distance   1000  color      rgb <1,1,1>*0.75  fog_offset 50  fog_alt    10}

但是,此刻所设置的雾不会起作用,天际依然蔚蓝,地平线依然清晰。这是因为,用来作为天空和云层的两个球体,都是实心的。要想让雾显现,必须使用 hollow 将这两个球体变成中空的:

// 天空sphere {  <0, 0, 0>, 5000  hollow         // <-- 注意此处  texture {    pigment {color rgb <0.1, 0.25, 0.75>}    finish {      ambient <1, 1, 1>       diffuse 0    }  }}// 云sphere {  <0, 0, 0>, 4000  hollow         // <-- 注意此处  texture{     pigment{       bozo turbulence 0.75      color_map {        [0.0  color rgb <0.95, 0.95, 0.95>]        [0.05  color rgb <1, 1, 1>]        [0.15 color rgb <0.85, 0.85, 0.85>]        [0.55 color rgbt <1, 1, 1, 1>]        [1.0 color rgbt <1, 1, 1, 1>]      }      scale 0.25 * 4000    }    finish {ambient 1 diffuse 0}  }}

现在,天际有雾了。

fog

fog_type 用于设定雾的类型,类型为 1 时是简单雾,这种雾会让整个画面都朦胧;类型为 2 时,是地面上的雾。在渲染野外场景时,地面雾最常用。

distance 用于设定雾气的远近。例如,将雾拉近一点:

fog{   fog_type   2  distance   10  color      rgb <1,1,1>*0.75  fog_offset 50  fog_alt    10}

就可以达到草船借箭级别的雾效:

fog

fog_offset 用于设定雾距离地面的高度(y 坐标值)。fog_alt 用于设定雾层浓度的衰减速率,值越大,衰减速率越小。

不过,上面的雾效与我们这个世界的自然现象不符。因为,这么大的雾天,物体不可能在地面上留下阴影。若要消除物体的阴影,需将光源设置为无影光源(类似医院里的无影灯):

light_source {  <2000, 4500, -100>  color White  shadowless}

无影光源之下的雾效

下面给出一份完整的 .pov 文件以供参考:

#version 3.7;#include "colors.inc"// 相机camera {  location <0, 2, -3>  look_at  <0, 3,  8>}// 光源light_source {  <2000, 4500, -100>  color White}// 天空sphere {  <0, 0, 0>, 5000  hollow  texture {    pigment {color rgb <0.1, 0.25, 0.75>}    finish {      ambient <1, 1, 1>       diffuse 0    }  }}// 云sphere {  <0, 0, 0>, 4000  hollow  texture{     pigment{       bozo turbulence 0.75      color_map {        [0.0  color rgb <0.95, 0.95, 0.95>]        [0.05  color rgb <1, 1, 1>]        [0.15 color rgb <0.85, 0.85, 0.85>]        [0.55 color rgbt <1, 1, 1, 1>]        [1.0 color rgbt <1, 1, 1, 1>]      }      scale 0.25 * 4000    }    finish {ambient 1 diffuse 0}  }}//雾fog {   fog_type   2  distance   1000  color      rgb <1,1,1>*0.75  fog_offset 50  fog_alt    10}// 大地plane {  y, 0  texture {    pigment {      color rgb<0.35,0.65,0.0>*0.8    }    normal {      bumps 1.25       scale 0.015    }  }}// 大石块#include "stones.inc"box {  <0, 0, 0>, <1, 1, 3>  texture {    T_Stone25  }  scale 3  rotate 45 * y  translate 5 * z}

转载地址:http://hltwm.baihongyu.com/

你可能感兴趣的文章
Linux基础之vi(vim)程序编辑器
查看>>
在已知IP的基础上,批量管理cluster IP脚本思考
查看>>
自己研究的长方形二维数组旋转90度
查看>>
Keepailved详细介绍
查看>>
Zabbix 3.4.3通过钉钉机器人报警
查看>>
ASP.NET中利用cookies保持客户端信息
查看>>
正则表达式的基本应用
查看>>
C#查找列表中所有重复出现元素代码
查看>>
rpm 和 yum 详解
查看>>
EOS源码分析(一)投票系统
查看>>
菱形虚拟继承&虚函数表&对象模型
查看>>
宏和函数的简单比较
查看>>
批量生成httpd-2.2十个虚拟主机配置
查看>>
红杉、IDG、北极光、顺为等投资大咖怎么看智能硬件
查看>>
Centos 7 破解root密码
查看>>
如何使用Visual Studio调试C#程序
查看>>
简单易操作的去水印工具有什么
查看>>
我的友情链接
查看>>
mysqldump: Couldn’t execute 错误
查看>>
给新手的Oracle学习路线
查看>>