tips
Treetop walkway in CityEngine
Inspired by the treetop walkway in Kew gardens I thought I’d make a quick rule file to change a road network into one. Here is a screen capture of the result.
It is really quite simple and small as rule files go, and I still need to make proper handrails and of course an access point (stairs and lift). I used SketchUp to model the pylon and then adjusted the road width to a walkway width and the sidewalks are used as railings. Instead of junctions I used roundabouts and placed the SketchUp pylon model in the centre of the roundabout.
I hope to put this example and others up online in the near future….
Quick Tip : Using CityEngine’s colorRamp Function
UPDATE : You can view a demo of this rule file in action here via CityEngine’s webscene web viewer
This is a fun quick tip, instead of assigning a specific colour to each floor and building when not use the built in colorRamp function. Search for it in the help file for detailed usage here’s how I’ve used it:
I’ve taken a centre point and coloured the rooftop of each building using the colorRamp function. Basically it checks to see how far it is from a chosen point (fixed in the rule file) and normalises it so the value is between 0 and 1 and then uses that value to pick a colour in the depending on your chosen colorRamp.
Mobile CityEngine Web Viewer (WebGL on Android)
This is interesting, I was looking at viewing CityEngine web scenes on my iPad and apparently it is capable (webGL is supported in adverts) but only if you jailbreak it. I’m not really prepared to go down that route, I might break it and then my 3.5 year old daughter would be mad at me.
So I looked at weather my new Samsung Galaxy S3 could view webGL content. Well no it can’t by default except when you download the beta version of Chrome Beta for Android! What you do is install Chrome Beta and type into the address bar Chrome://flags and then enable webGL, of course then you point your Chrome Beta browser at your favourite CityEngine webscene. So far it seems ok, there are times when the 3D is a bit sluggish, the big issue is that you can’t navigate the model by touch, so you have to really on the bookmarks. Also the slider for moving between two scenes doesn’t work. My guess is this can be programmed in, as soon as one of ESRI’s nice CityEngine developers (who read this blog?) feel like a quick side project for me….. ?
Don’t believe me? Here are some screen shots (not got a 3D view as the screen capture software won’t let me… I’ll try again later)
Top Tip for CityEngine – Detailed to Simple Model Toggle
Just a quick tip this one, and it starts to help you when you make very large city/urban models. When you are starting to add more detail to your rule file buildings like nice windows or doors (or in my case balconies and air conditioning units) it’s always best to create a simplified model at the same time. That way you can create a mechanism to speed up CityEngine, remember the more detail it has to draw the more PC resources it needs.
Once you’ve done this you can use the following rule syntax to enable easy switching off and on of the detail without losing the feel of your model. Remember your urban model maybe small now, but because you will inevitably reuse this rule file and asset, it’s best to ‘front load’ some of the work.
attr toggledetail = false asset_balcony = case toggledetail == true : "assets/detailedBuildings/BuildingFeatures/balcony.obj" else : "assets/detailedBuildings/BuildingFeatures/balcony_simple.obj"
Translating text for ArcGIS – Google Translate + Excel – A quick guide
This is a useful tip that has been pointed out to me by a colleague, so useful in fact I have to make sure I note it down somewhere. Until my idea is incorporated into ArcGIS this is a quick and dirty workaround for translating Arabic labels in ArcGIS.
We have received some GIS data from a client, it’s landuse in a geodatabase with Arabic labels. Trouble is our maps are needed in English! In the past we’ve tested the Microsoft translation tools (for office) against Google’s online translate tool and found that Google does a much better translation.
So how do we translate this large landuse table quickly and easily? Use Excel of course! Please note that this bullet point list assumes you know ArcGIS and Excel quite well, to instruct from a beginners point of view would be a bit to long winded for me.
- First create a field name for the English Translation in ArcGIS
- Open a new Excel document
- Copy (using this method) the table from ArcGIS into Excel.
- Create a PivotTable that lists the row labels (in this case Arabic Landuse)
- Copy and paste this list out (so the text is static, you probably don’t have to)
- Copy the Arabic text into the text box at translate.google.com
- Now Copy that English translation text list back adjacent to your Arabic landuse list into Excel
- Now you have to use some Excel magic, select the English and Arabic text and under the Formulas tab (in Excel 2007) define a name ( in this case I called it English Translate)
- Once you have done this go to the English Landuse field name column and type in code like this “=VLOOKUP(E7,EnglishTranslate,2)”. E7 is the Arabic landuse in your original table in Excel, EnglishTranslate is that Name you defined above and the number 2 is the column number of the EnglishTranslate you need to use if matched.
- Then click and drag copy this down your English translation field to check it works.
- Now copy back this data into ArcGIS or Join/Link it.
Well that’s it if you have any improvements/questions/suggestions please add them in the comments section below!
CityEngine + OS Opendata + Forestry Rule file Part 2
Okay this is a modification of this previous rule file it’s been one of my more popular posts in recent weeks.
So as the caption says I’ve used to methods to control colour and height of trees. Using the scatter function I place my tree and then colour via an elevation test and scale via a brightness test on some geology data.
Tree density is controlled by a tree per square metre variable.
Not wishing to put the whole rule out there, here are the relevant tests, if you know anything about CityEngine you’ll probably tell me there’s another way…
attr colourbyelevation = //test by heighest first > greater than xxx metres
case convert(y,pivot,world,pos,scope.sx,scope.sy,scope.sz) > 350 : "#ff0000"
case convert(y,pivot,world,pos,scope.sx,scope.sy,scope.sz) > 330 : "#ffff00"
case convert(y,pivot,world,pos,scope.sx,scope.sy,scope.sz) > 330 : "#00ff00"
case convert(y,pivot,world,pos,scope.sx,scope.sy,scope.sz) > 300 : "#00ffff"
case convert(y,pivot,world,pos,scope.sx,scope.sy,scope.sz) > 0 : "#0000ff"
else : "#00000"
attr treehegeotypeightbygeology =
case GeoType > 0 : 50
else : 25
The beauty of CityEngine is apparent when you realise this doesn’t have to be trees or elevations or geology, and you can combine these tests with other rules to make something truly complicated.
Lumion 2.5 & AMD Driver 13.10 – “Not the same!” message – Fixed
“not the same! 1024″
“not he same2! 512
desc.width 64
Recognise these error messages?
Just a quick post, if like me you have an AMD (HD6900 series) graphics card and have been getting strange messages from Lumion 2.5, it might be to do with the latest version of the driver (13.10).
If you want to get rid of the error messages you need to roll back driver version 12.10… seems to have worked for me. You can get the old drivers here : http://www.techpowerup.com/downloads/Drivers/ATI_Catalyst/old/
Or go to your device manager in windows, select the graphics card and on the Driver tab click the Roll Back Driver update… As with most things only do this if you’re confident you can get things working again if it all goes wrong!
Related
- AMD/ATI graphics card: Warning about the latest driver (13.10) (registration may be required)
Geodesign tool on the cheap? wii remote + infrared pen + projector + ArcGIS
I’ve been toying with the idea of purchasing a Wacom Cintiq device. In our line of work hand drawing is important still and the amount of tracing (I mean digitizing) I do hasn’t decreased.
Prior to that I need to justify it to myself and my colleagues that a mouse and keyboard just isn’t going to cut it for much longer…
Here’s what you need:
- Wii remote (an old one will do without the sensor thingy)
- Smoothboard.net software + infrared pen, you can get a kit from here I would recommend a dual pen with button and pressure sensitive nib, that way you can use it on a hard and soft surface
- Wii battery cover with camera tripod fitting (you can make or buy one)
- Projector (we have an old one but I recommend something that’s bright short throw and high resolution)
- PC or laptop with Bluetooth!
Really the infrared pen is the difficult bit to get, you can make it yourself but I suggest you get it from people like this http://www.infraredpen.co.uk/index.php/ (not a product endorsement but that it is where I got my kit and it came pretty quick.
Basically it all worked for me. Follow the install instructions and it really is incredibly simple. One thing I would warn is that if you’re using the Wii remote at home you might find it wants to connect to the Wii rather than your laptop.
I’m using an old Wii remote, a Dell Vostro 3300 laptop (with windows 8 see here), getting the angle of the wii remote (it has an infrared camera in it) is crucial. Also it takes some getting used to drawing whilst keep your shadow out of the way.
Here is a picture of me, I’m not in a dark room, it’s the camera adjusting for the brightness of the projector.
Bottom line here: don’t discount cheap workarounds this setup works very well with ArcGIS, don’t make this stuff just buy it from someone who does. We’ll be taking this setup to a meeting with some people we’re working with in a couple of weeks. Instead of them drawing on a piece of paper and then digitizing it into the GIS we’re going to draw directly into the GIS.
Side note: this didn’t seem to work with CityEngine, It’ll try and figure it out and get back to you…













