2
$\begingroup$

it's my first post in this community. English is not my mother language, so if there's any inappropriate word, let me know and I would fix it. Thanks!

Here's my question, I am making a cube with mountain landscape in geometry node with some limitations.

  1. The landscape or the mountain surface only reveal on one face (personally set on top face)
  2. The cube size can be adjusted (total height, length, width)

The main problem I am facing is that I don't know how to use the edge of the landscape I already created, and extend on one certain face and close it. So I can control the height of the object.

Here's some screenshots show my current geometry node.enter image description here

enter image description here

Here's the completion that I expect. enter image description here

Wish someone can help me answer this question!

$\endgroup$

3 Answers 3

4
$\begingroup$

You could start with a Mesh Primitive > Grid, then Mesh > Extrude it, and displace only the provided 'Top' selection.

enter image description here

Of course, the parameters exposed to the modifier are up to you.

enter image description here

To guarantee square subdivisions, the interface to grid construction is arranged as follows:

enter image description here

... which snaps the size to a whole number of squares, and subdivides accordingly. 'Resolution' is then measured in squares per Blender Unit. (1/Res is a Divide node, Sx*R+1 and Sy*R+1are Multiply Add nodes)

$\endgroup$
5
  • $\begingroup$ Thanks! That looks much easier and adjustable! I will try later! $\endgroup$
    – Hao-Wei.H
    Commented Jun 13, 2022 at 9:40
  • $\begingroup$ Hi, @Hao-Wei.H ! See Edit, for one way of modifying the interface. $\endgroup$
    – Robin Betts
    Commented Jun 13, 2022 at 12:41
  • 1
    $\begingroup$ Perhaps worth to note, this produces non-manifold geometry because there's no enclosing bottom floor - producing one is easy, just duplicate the top grid, don't displace it, join with the rest and Merge by Distance. $\endgroup$ Commented Jun 13, 2022 at 12:57
  • $\begingroup$ Thanks a lot! I will try later! Wish u have a nice day! $\endgroup$
    – Hao-Wei.H
    Commented Jun 13, 2022 at 13:11
  • $\begingroup$ @MarkusvonBroady Thanks! Have corrected, and updated download. $\endgroup$
    – Robin Betts
    Commented Jun 13, 2022 at 13:35
3
$\begingroup$

if you start with a default cube and you add this geometry node setup:

enter image description here

enter image description here

you will get this:

enter image description here

First i split the edges so i can separate the top face, subdivide that top face for the "mountain building" and give a noise modifier for z-randomness (creates the mountains). With the multiply add vector node i mask only the x and y values and set the z values to 1 so that the cube will be closed, but only for x and y values which are either 1 or -1.

$\endgroup$
1
  • $\begingroup$ Thanks! I will try my best to understand ur method! If there's any question, let me asks you more! $\endgroup$
    – Hao-Wei.H
    Commented Jun 13, 2022 at 9:06
0
$\begingroup$

I was wondering how to produce n-gons on sides...

The Clamp Index node:

Basically if a side has 4 vertices, at first consider their indices to be:

0, 1, 2, 3

Now spawn an n-gon with two more vertices, and consider their indices to be:

-1, 0, 1, 2, 3, 4

Now clamp the additional vertices to the former range:

0, 0, 1, 2, 3, 3

If you clamp, output a 1; 1; 0 vector, which, multiplied by coordinates, will set Z to 0. If you don't clamp, output a 1; 1; 1 vector, which, multiplied by coordinates, will not change them.

Finally sample the positions taking advantage of deterministic vertex indexing in the Grid node: One side has the first indices, the opposite has the last indices, and perpendicular edges go in stride increments of a row length. Sometimes you need to reverse the order of indices to get the correct normal (aim for counter-clockwise winding).

$\endgroup$
3
  • $\begingroup$ BTW, you probably don't want the n-gons. If you want to save on geometry, remember you're only saving half-1 faces internally/on export, due to triangulation. You may want to resign from Merge By Distance... $\endgroup$ Commented Jun 13, 2022 at 18:10
  • 1
    $\begingroup$ Wow! that's a clean method! Thanks a lot for sharing your knowledge! Wish u have a nice day! @MarkusvonBroady $\endgroup$
    – Hao-Wei.H
    Commented Jun 14, 2022 at 3:09
  • $\begingroup$ @Hao-Wei.H just keep in mind usually you actually want the topology generated by Robin Betts' or Chris' answer. $\endgroup$ Commented Jun 14, 2022 at 8:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .