Then open up thinking, how to use programming ideas for three-dimensional modeling (1)
I. This time has a preliminary style, then we do something more dazzling. Windows are the same, can we do random transformations? Then the filerandom () function appeared
declaring random files * is equivalent to fuzzy matching, winname=filerandom ("1409020150_15553.obj/sash_window_*.jpg " ) Window---"1) projectuv (0)// Winname picture Texture (winname)
J. You may now say, it is the stickers, can not be so low, okay, we can add some three-dimensional windows
window-->'1)//projectuv (0) texture (winname)//I () Replace function Replace I with three-dimensional model ( " 1409020150_15553.obj/sash_window.obj ")
K. is the building only square? In fact, we also use the three-dimensional model to replace the main body, change the appearance of the building (such as column)
building-->//I () cylinder replacement Buildingi ("1409020150_15553.obj/cyl.obj") Comp (f ) {Top:roof|side:wall}
L. do we write buildings that can only be static? In fact, we can set the length of the dead to the variable attribute, so we can change at will!!! (Paste all the code again)
Version"2014.0"//declare a random number limit height altitude @range (20,100) attr Hight=20//floor height attr floor_height=3/the width of the wall attr Wallside=0.5//window width attr winsize=2//Start Rule @startrulelot-extrude (Hight) buildingbuilding-I ("1409020150_15553.obj/cyl.obj") Comp (f) {Top:roof|Side:wall} Roof-setupprojection (0,scope.xy,'1,'1) PROJECTUV (0) texture ("/esri.lib/assets/roofs/flat/flatroof_10.jpg") Wall-Split (y) {~floor_height:floor}*Color (1, 0,0) Floor-Split (x) {wallside:wallside|{~winsize:tile| wallside:wallside}*}tile-Split (y) {wallside:wallside|{~winsize:window|Wallside:wallside}} Winname=filerandom ("1409020150_15553.obj/sash_window_*.jpg") Window-setupprojection (0,scope.xy,'1,'1) PROJECTUV (0) texture (winname)I"1409020150_15553.obj/sash_window.obj") Wallside-setupprojection (0,scope.xy,1, 1) PROJECTUV (0) texture ("/ganzhou/assets/wall_textures/stone/wall_stone_4.jpg")
Well to now almost can achieve the building of the generation, although not very good!!!!! Let's finally look at the structure of the building.
Take a look at it. Based on the rule batch generation model, select some plots to drag into the specification, as follows
All right, that's all I have to say. I have to admire the idea of foreigners, so easy to model, and can be exported in the browser to view, finally share I do a few buildings and I participated in their company held the college student competition video (beginner only a winning prize), interested can exchange a bit,
Video path:http://v.youku.com/v_show/id_XMTQwMjAzMDEyMA==.html
Pioneering thinking, how to use programming ideas for three-dimensional modeling (2)