2

I'm trying to have a grid of cylinders with different heights, using Geomery Nodes.

My initial idea was to use a Noise Texture to get a field of values that I then give to a Cylinder primitive. enter image description here

This is not working as it can't transform a field into a value, but the idea is there: I want each cylinder to have a different height, based on the value of the texture at those coordinates.

How can I achieve that?

NOTE: I don't actually need a grid of cylinders, I need a grid of complex object created by a custom group with inputs. My question is mostly on "how to change that field into a value".

SteeveDroz
  • 215
  • 2
  • 6

2 Answers2

4

Another possibility would be to move the cylinder caps after instantiation.

To do this, mark them before instantiation, add a random value to the instances, and after the instances are realized, move these marked points to the desired position.

enter image description here

By the way, this question/answer explains why you get a red line:
Why is there a red line when I try to connect one node to another?


(Blender 3.6+)

quellenform
  • 35,177
  • 10
  • 50
  • 133
  • Good answer, I edited the question to indicate that the problem is simplified in it, I actually need to apply that to a custom object and not a cylinder. I can't use a workaround on this :-( – SteeveDroz Aug 09 '23 at 10:11
  • 2
    @SteeveDroz I understand. With this technique, however, you could mark any part of your procedural geometry beforehand (and not just the cylinder caps as in this example). This would allow you to move certain points after instantiation. – quellenform Aug 09 '23 at 10:13
2

You see that red line? That means an error. What error? Well, the output from the noise texture is a field output. Where as the cylinder primitive takes only singlular float values. Blender cannot that you want a grid of cylinders and you want the cylinders to change heights according to a noise texture which is based on the position.(The default value of the noise texture vector input is the position field)

How do you achieve what you want?

Well for that you will need the grid of cylinders to exist first and then control their heights after that.

I have a setup in which I have used grid of circles and extruded them using the noise textures.(I wasn't able to figure it out with cylinders, hehehe, sorry)

enter image description here

enter image description here

The Kalaakaar
  • 2,181
  • 3
  • 21
  • Thanks, but it doesn't help. In fact, my question is a simplification as I don't really need cylinders but a custom group that has a value input. That wouldn't work. – SteeveDroz Aug 09 '23 at 10:07
  • 1
    Ok, so it would be helpful if you change the question in that case. Basically the noise texture will be evaluated according to the position of the object. If you want a list like you said in the question, then idk, probably scripting then. If you want a value per object then you can capture it or something like that. Also check the other answer that was just posted. It's a much better method. – The Kalaakaar Aug 09 '23 at 10:12
  • .. or use the captured noise-on-points value just to scale instances in Z? Maybe that's an unwanted deformation. – Robin Betts Aug 09 '23 at 10:33
  • 1
    @SteeveDroz As Akshay says, if it's a simplification but you want something different, it is better to ask a question which tells us what you want because otherwise this might lead to incorrect solutions. But Akshay: of course you can change the height of the cylinders instanced on a grid by a noise texture. But you have to scale the instances, not the original object. Because (unless you instance a collection) the original object can only have a single original geometry. This can be manipulated on the instances though: scale instances – Gordon Brinkmann Aug 09 '23 at 10:50
  • @GordonBrinkmann I was going to do exactly what quellenform did. I had a setup similar to it. What I forgot was capturing the top first instead of just directly plugging it. That made all the points go up and down. So just to help out this person, I made a setup with circles instead. – The Kalaakaar Aug 09 '23 at 10:53
  • Well sure, to move the points upwards you have to go a different way. But at first when it seemed as if he wanted to use it on cylinders, simply scaling them would have been easy... – Gordon Brinkmann Aug 09 '23 at 11:03