Randomising facade textures

2066
6
05-17-2012 02:54 AM
CarolineSteer
New Contributor III
Hi there,

I'm currently creating a model of a city and I'd like my rule file to pick a random texture based on the building's height(like the Philadelphia example). I've organised all my photos into files based on the number of floors with multiple textures for each floor, however everytime I generate the buildings it always uses the same texture for each building with the same number of floors and not utilising the others. How does the fileRandom function work exactly- does it iterate everytime you run the rule or by individual feature? I've attached my rule file to make it a bit clearer, it might be as a result of how I've written it!

In a different point altogether, it would be really great if you could within the help files explain how to setup the projections for projecting on to buildings and roofs so everything aligns correctly because it's something I know I've personally found difficult!

Any help would be great!!

Caroline
Tags (2)
0 Kudos
6 Replies
MatthiasBuehler1
Frequent Contributor
hi ..

I guess for your specific use it may be easier to use the Facade Wizard instead of creating complex rules which need to pull indices such it is the case in e.g. the City Wizard's Textured City.

I'll try to prepare something for you, ok ?

Cheers !
0 Kudos
CarolineSteer
New Contributor III
Hi Matthias,

I've not yet done anything with Facade Wizard so that would be incredibly useful if you build similar using this!

Many thanks,

Caroline
0 Kudos
MatthiasBuehler1
Frequent Contributor
hi Caroline,


Can you meanwhile download tutorial 13 and check the html tutorial docs which are stored in the project ?

I'm very busy again and have to check when I finally get some time to help you with this.

I'm sure it will help you meanwhile.
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hey Caroline.

It's taken some time, but watch this vid I made :
(watch in HD!)

http://video.arcgis.com/watch/1781/tutorial-13-facade-wizard

Cheers Matt
0 Kudos
BenLeslie1
Occasional Contributor III
I can't get fileRandom to work to assign random textures.  This is the way I want to do it:
attr txtIdent = ""

attr txtPath = "images/New Textures_test/"
attr txtExt = ".jpg"

buildingSide-->
case txtIdent == "":
 setupProjection(0, scope.xy, '1, '1)
 texture(fileRandom(txtPath+"*"+txtExt)
 projectUV(0)
else:
 texture(txtPath+txtIdent+txtExt)


but I have also tried like this, assigning the random file to a constant first as per tutorial 7

const myRandomTxt= fileRandom("images/New Textures_test/*.jpg")
attr txtIdent = ""

attr txtPath = "images/New Textures_test/"
attr txtExt = ".jpg"

buildingSide-->
case txtIdent == "":
 setupProjection(0, scope.xy, '1, '1)
 texture(myRandomTxt)
...


I tried moving the * around and including more and less of the file name but I get nothing in return.  And the textures work if I assign a txtIdent value.
0 Kudos
MatthiasBuehler1
Frequent Contributor
no spaces allowed in paths .. !
0 Kudos