首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

CityEngine制造玻璃材质反光效果

2012-12-31 
CityEngine制作玻璃材质反光效果 当我们走在城市的大街上,经常会看到很多栋写字楼,其外墙大多都是玻璃材质

CityEngine制作玻璃材质反光效果
 

当我们走在城市的大街上,经常会看到很多栋写字楼,其外墙大多都是玻璃材质的,使得建筑更有质感。在本文中,我们利用CityEngine实现玻璃材质反光效果。首先,需要确定做什么样的效果?一是玻璃效果(即透明),二是反光。

在CityEngine中提供了“Material”设置,即材质。其属性包括如下,本文用到了红框内的属性。

CityEngine制造玻璃材质反光效果

编写规则如下:

version"2012.1"

#属性参数定义

attrFloor=10

attrFloor_Height=3

attrGroundfloor_Height=4

attrHighBuilding_Color="#6892d7"

#变量定义

Building_Height=Floor*Floor_Height

constTile_Width=1.8

constFloorTop_Hight=0.1

constFrame_Width=0.08

@StartRule

#生成建筑结构

Lot-->

   extrude(Building_Height)

   HighBuilding

   

#切分出第一层和上面楼层

HighBuilding-->

   split(y){Groundfloor_Height:FloorVolume|{~Floor_Height:FloorVolume}*}    

#拆分出每个楼层的地面和侧面

FloorVolume-->

   comp(f) {top :offset(-0.1,inside)FloorTop|side:FloorSides}

#楼层地面填充颜色

FloorTop --> color(0.5,0.5,0.5)

#侧面生成玻璃窗户

FloorSides -->

   split(x) {~Tile_Width : FloorTile }*

FloorTile -->

   offset(-Frame_Width/2)

   comp(f) {border :color(0.2,0.2,0.2)Frame. |inside :Glass}

   

#制作玻璃反光效果

Glass -->

   color(HighBuilding_Color)

   set(material.opacity, 0.4)

   #镜面反射

   set(material.specular.r,0.6)

   set(material.specular.g,0.6)

   set(material.specular.b,0.6)      

   set(material.shininess,50)

   #反射率

   set(material.reflectivity, 0.2)

生成效果图:

CityEngine制造玻璃材质反光效果

练习数据:下载

更多关于材质的属性设置,可以在CityEngine帮助中搜索“material”关键字来查看。

热点排行