CityEngine Security Camera Demo – Video & CGA Code

I saw the CityEngine webinar yesterday on “3D Cities for Safety and Security”   and got inspired by their security camera rule, I thought I could do that quite quickly so came up with this:

Here’s the code for those that like this sort of thing (it’s not carefully commented by feel free to modify and share) I’m aware the CityEngine team have something much more sophisticated but for 5 minutes coding I think it’s quite nice:

 

/**
 * File:    camera.cga
 * Created: 19 Dec 2013 16:18:39 GMT
 * Author:  EHartley
 */

version "2013.1"

@Color
attr cameraColor = "#ff00ff"
@Range(0,1)
attr cameraTransparency = 0.5	
@Range(0,360)
attr cameraRotate =0
@Range(0,360)
attr cameraAngle =0
@Range(0,1000)
attr cameraDistance =20
@Range(0,100)
attr cameraHeight = 2.5
@Range(0,100)
attr cameraH = 64
@Range(0,100)
attr cameraW = 48
pyramid = "assets/pyramid.dae"

@StartRule
box-->
	color(cameraColor) set(material.opacity,cameraTransparency)
	//extrude(cameraHeight)
	i("builtin:cube")
	s(cameraH,cameraHeight,cameraW)
	center(xyz)
	comp(f) { top : camera | all : NIL}

camera-->
	//reverseNormals
	roofPyramid(30) s('1,cameraDistance,'1)
	r(0,cameraAngle,cameraRotate)
	center(xyz)
	t(0,-cameraDistance/2,0)

Central London – Tower Treetop – Video

ce_central_london_multifloor

This is the start of adding more ”smart data” to buildings beyond just a ‘dumb’ grey building and/or textured.   CyberCity3D give roof details, heights, angles and roof type but are looking at adding for specific buildings floors and other attributes.   I thought I’d jump ahead and see what I could with that kind of information in CityEngine.

So what if you had floor levels within buildings? You could run any rule you wanted on each floor or place in a detailed floor plan. Or you could put a park on a well known building landmark and give each floor a pretty colour…..

The “Gherkin” was modelled in more detail separately (using SketchUp in this case), this specific model is not part of the CyberCIty3D dataset.

 

ce_central_london_multifloor_color_by_area
Floors Colour by Area in CityEngine pretty but also potentially useful for proerpty management companies?

CityEngine at Speed – Video

My first video to have a musical background (free from YouTube Library), please accept my apologies if it gets annoying…

The video itself was first shown at the Geodesign Summit in Redlands in January 2013, it got a laugh as it was speeded up, I suggested at the time using Benny Hill music over the top but chickened out for this version…

Auto-texturing in CityEngine & export to LumenRT

Update : Now with added video

Just a quick progress report:  The LumenRT stock rule files and textures with simple modifications can be used on other projects.   I’m using CyberCity3D’s

RealLondon3D data here which I’ve very quickly used a texturing rule file and then exported out to LumenRT.

ce_lumenrt_London_1
It’s fun to get to this quality of render in under 15 minutes…
ce_lumenrt_London_5
Some textures have not been as successful as others
ce_lumenrt_London_4
Night time effects can hide most mistakes…
ce_lumenrt_London_3
LumenRT comes with models and rule files that add real lighting effects
ce_lumenrt_London_2
I wish CItyEngine could handle terrains better….