What can be modeled? The most common motif are landscapes with the following objects that we want to create in some cases:
- Change the parameters!
- How about wells with water?
- How can get/create a snowy mountain?
How can a script gnereate a mountains like the - yellow and orange parts of the image, what looks like the Uluṟu . Soon we are smarter ...
Again we are using a class as a starting point.
We are starting with a plane and increase the number of units to 100x100.
A small earsquacke
We divide the ground multiple times and to get some randomness we use the parameter fractal. It is only a small erathquake because we are moving only a few point a little bit.
A smaller part of the ground should be higher and we do this with multiple steps. We using a bmesh to manipulate the koordinates.
bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_all(action='TOGGLE') bpy.ops.object.editmode_toggle() me = obj.data i = random.randint(0, len(me.vertices)) obj.data.vertices[i].select = True bpy.ops.object.mode_set(mode='EDIT') for i in range(5): bpy.ops.mesh.select_more() bm = bmesh.from_edit_mesh(obj.data) for vertex in bm.verts: if vertex.select: vertex.co.z += 11 bmesh.update_edit_mesh(obj.data) bpy.ops.transform.resize(value=(.9, .9, 0)) for vertex in bm.verts: if vertex.select: vertex.co.z += 15 bmesh.update_edit_mesh(obj.data) bpy.ops.transform.resize(value=(.8, .8, 0))