Page **1** of **1**

### generated height-maps and renders

Posted: **Wed Jul 07, 2021 7:03 am**

by **barcud**

Here is my attempt of generating a heightmap with ContextFree

- CityMap_7cAAIgreys3mini.jpg (95.96 KiB) Viewed 89610 times

Using the free height map rendering tool

aerialod I rendered this image out of it:

- snap2021-07-07-10-31-28mini.jpg (154.25 KiB) Viewed 89610 times

The script is a basic subdivision with a bit of overlap and then two loops with a bit of random thrown in to create a bigger picture.

Code: Select all

```
CF::MinimumSize = 4
startshape big
rsi = 0.46
shape quad
rule {
SQUARE[ s 1.015 b -1]
SQUARE[s 1 b 1 ]
}
shape big
{
loop 4 [y (0.5+rand(0.8))]big_x[s 1 (1.2+rand(0.5))]
}
shape big_x
{
loop 4 [x (1+rand(1))] frac[s (1.2+rand(0.58)) 1]
}
shape frac
rule {
quad[ ]
frac [x 0.25 y 0.25 s rsi r -90 b -0.9]
frac[ x -0.25 y 0.25 s rsi r 0 b -0.8]
frac[ x -0.25 y -0.25 s (rsi/2) r 90 b -0.7]
frac[ x 0.25 y -0.25 s rsi r 90 b -0.6]
}
rule {
quad[ ]
frac [x 0.25 y 0.25 s rsi r -90 b -0.6]
frac[ x -0.25 y 0.25 s rsi r 0 b -0.7]
frac[ x 0.25 y -0.25 s (rsi/2) r 90 b -0.8]
frac[ x -0.25 y -0.25 s rsi r 90 b -0.9]
}
```

Enjoy!!

### Re: generated height-maps and renders

Posted: **Sun Jul 18, 2021 4:01 pm**

by **shevy**

This is pretty cool; it reminds me of RPG maps, like

in Shadowrun.

How did you have this idea? And the follow-up render idea? I never

heard of aerialod before. I assume you must have some experience

with that? It looks a bit like an artistic rendering actually - I saw

somewhat similar renderings done via blender on the old cg-forum

if anyone remembers that...

Edit: The name is city map? I usually look at the gallery first actually

and less so on the forum.

### Re: generated height-maps and renders

Posted: **Mon Jul 19, 2021 3:43 am**

by **barcud**

Aerialod was also a new one for me - it's another free program by the guy who did MagicaVoxel and I follow him on Twitter - that's how I came across it.

I have only recently (re)started with Context Free - I am actually a

StructureSynth person - a (sort of) 3D version of CFDG. I had generated some map like thing in Structure Synth and somebody asked if it would be possible to do that in ContextFree so I gave it a go and it worked quite easily.

Using StrucutreSynth I quite often export objects and render them externally so I am quite used to that and using heightmaps is just one of those things that's quite handy for all kind of surface structures in renders and/or when you are doing fractals in Mandelbulb3D.

The "City map" gallery is close but the real code for the map is in the post.

### Re: generated height-maps and renders

Posted: **Fri Sep 03, 2021 6:34 am**

by **barcud**

Here is another heightmap render

The CFDG script is again a basic subdivision and it is grey on black - the whiter the colour get the higher the building

Code: Select all

```
CF::MinimumSize = 4
CF::Background = [b -1]
startshape big
rsi = 0.4
shape quad
rule {
SQUARE[ s 1.1 b 0.2]
SQUARE[s 1 b -2 ]
}
shape big
{
loop 8 [y (0.5+rand(0.8))]big_x[s 1 (1.2+rand(0.5)) ]
}
shape big_x
{
loop 7 [x (1+rand(1))] frac[s (1.2+rand(0.58)) 1 ]
}
shape frac
rule {
quad[ ]
frac [x 0.15 y 0.15 s rsi r -90 b rand(0.1,0.3)]
frac[ x -0.25 y 0.25 s rsi r 0 b rand(0.1,0.3)]
frac[ x -0.25 y -0.25 s (rsi/2) r 90 b rand(0.1,0.3)]
frac[ x 0.25 y -0.25 s rsi r 90 b rand(0.1,0.3)]
}
rule {
quad[ ]
frac [x 0.25 y 0.25 s rsi r -90 b rand(0.1,0.3)]
frac[ x -0.25 y 0.25 s rsi r 0 b rand(0.1,0.3)]
frac[ x 0.25 y -0.25 s (rsi/2) r 90 b rand(0.1,0.3)]
frac[ x -0.25 y -0.25 s rsi r 90 b rand(0.1,0.3)]
}
```

This results in this heightmap:

- CityMap_9b_KYK.jpg (179.67 KiB) Viewed 89141 times

and using the free tool

http://ephtracy.github.io/index.html?page=aerialod this results in this render:

- CityMap_9b.jpg (194.39 KiB) Viewed 89141 times

### Re: generated height-maps and renders

Posted: **Sat Oct 16, 2021 5:36 pm**

by **shevy**

This is REALLY really cool ... one could almost make a game from that,

like have cfdg auto-generate the base, then add on (at the least 3D objects

could be done; evidently a game may require a bit more effort, but that's

pretty cool to push cfdg to new frontiers).

It reminds me of those small model cities where you had very small cars.

Not sure if anyone collects them still ...

### Re: generated height-maps and renders

Posted: **Sat Dec 03, 2022 1:59 am**

by **jimyum**

barcud, really impressive, good job. By the way, it reminds me of cities with very small cars too