首页 > 编程知识 正文

线性城市模型(cityengine打不开的原因)

时间:2023-05-06 02:10:58 阅读:70843 作者:4344

以下是cityengine建模实例代码

所有必要的文本说明都在代码注释中注明

/* * file : my rule3. CG a* created 336020 feb 202108336045336029 GMT * author :86159 */version ' 2019.0 ' /以上为, 新规则rule文件附带的代码constgroundwall _ tex=' assets/ground wall.png ' const wall _ tex=' assets/wall.png ' const door 窗口. png ' /定义纹理图像为常量,“”部分为图像文件路径attr height=24 lot-- extrude (height ) Building Building-- comp(f ) f ) fronong side3360sidefacade组件隔离函数将各面分开,attrgroundfloor _ height=5.5 attr floor _ height=4.5 attr tile _ width=4front facade 命名为{~floor _ height 3360 up efloor } * }//纵切,在一楼底层,在其他上层,为upefloor--split(x ) 1: wall|(tile _ wite ) 墙面和无辜的服装Groundfloor-- split(x (重复横剪x {~tile _ width : ground tile } *|5: entrance tile|{~tile _ } 横向切割一层墙面和无辜服装tile-- sp pile 23360 split (y ) ) 1: wall|1.5: window|~ 1: wall (|~ 1: wall ) /无辜服装纵向将窗及窗上下分开的墙面groundtile--split(x ) (1:groundwall|2:split ) ) 1: ground wall|1.53360 window|13360 ground wall 纵切一楼无辜衣服,分隔门窗上下的墙面sidefacade----split(y ) ground floor _ height 3360 sidefloor|(floor _ height 3360 floor ) 相对于侧壁分割1楼大厅部分的地板不分割的sidefloor--split(x ) 1: ground wall|(tile _ width : ground tile )|13360groundwall楼根据前面GroundTile的定义,有窗的房间//以下是映射到各个部件的操作//其中门窗涉及伸缩,使用平移函数t(tx,ty,tz )可以实现groundwall--setupprojection(0) scooundwall-setup projection scope.sy (texture ) groundwall_tex (项目uv )0) wall--setupprojection(0,scope . scope.xy,scope.sx, scope.sy ) texture(window_tex ) projectUV(0)0) entrancetile-) entrance scope.sy(texture ) door_tex ) project scope.sx,scope.sy(texture ) wall_tex )项目uv )0) topfacade--setupprojection(0,scope.xy,scope.sx (/这张图是我要找的纹理图像存储位置的路径

很明显我的纹理图像是我在盲目寻找,其实是我在电脑壁纸上抠出来的不同位置的图。 (咳嗽,忍耐吧。 下次注意(bushi

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。