generated height-maps and renders

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
barcud
Posts: 8
Joined: Wed Oct 30, 2013 9:44 am

generated height-maps and renders

Post by barcud »

Here is my attempt of generating a heightmap with ContextFree
CityMap_7cAAIgreys3mini.jpg
CityMap_7cAAIgreys3mini.jpg (95.96 KiB) Viewed 109050 times
Using the free height map rendering tool aerialod I rendered this image out of it:
snap2021-07-07-10-31-28mini.jpg
snap2021-07-07-10-31-28mini.jpg (154.25 KiB) Viewed 109050 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!!
Last edited by barcud on Fri Sep 03, 2021 5:49 am, edited 1 time in total.

shevy
Posts: 11
Joined: Thu Jan 02, 2014 11:59 am

Re: generated height-maps and renders

Post 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.

barcud
Posts: 8
Joined: Wed Oct 30, 2013 9:44 am

Re: generated height-maps and renders

Post 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.

barcud
Posts: 8
Joined: Wed Oct 30, 2013 9:44 am

Re: generated height-maps and renders

Post 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
CityMap_9b_KYK.jpg (179.67 KiB) Viewed 108581 times
and using the free tool http://ephtracy.github.io/index.html?page=aerialod this results in this render:
CityMap_9b.jpg
CityMap_9b.jpg (194.39 KiB) Viewed 108581 times

shevy
Posts: 11
Joined: Thu Jan 02, 2014 11:59 am

Re: generated height-maps and renders

Post 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 ...

jimyum
Posts: 1
Joined: Sat Dec 03, 2022 1:28 am

Re: generated height-maps and renders

Post by jimyum »

barcud, really impressive, good job. By the way, it reminds me of cities with very small cars too :wink:
My zodiac sign is Cancer. From the Cancer compatibility chart, I knew that I could get married and be happy with Pisces. The most interesting thing is that I am married to Pisces and I am happy!

Post Reply