8
$\begingroup$

I'm trying to create something like a stack of cards using Geo Nodes. Following a tutorial on YouTube, I managed to arrange the cards along a curve using the Resample Curve node. Now, I want to give the cards a random rotation around the Z-axis to make the stack look more natural. I've attempted to use the Rotate Instances node, but it didn't work, and I'm not quite sure how to achieve what I have in mind.

The nodes I've used. blender file screenshot

Card stack I'd like to create pile of cards example

$\endgroup$
5
  • 1
    $\begingroup$ noise texture (scaled up or down) + euler rotation (on Z) and plug that in the instance on point rotation, most likely $\endgroup$
    – lemon
    Dec 4, 2023 at 18:25
  • $\begingroup$ @lemon, thank you for your response! However, I'm still having trouble understanding how to constrain the rotation to the Z-axis. I attempted to incorporate those geonodes, but now it's rotating on all axes. $\endgroup$
    – newbie
    Dec 4, 2023 at 18:35
  • $\begingroup$ UPD: i've done rotation with combine XYZ node. Now I would like to break the curve into segments and rotate these segments relative to each other. Could you please advise on how to achieve this result? $\endgroup$
    – newbie
    Dec 4, 2023 at 18:54
  • $\begingroup$ make segments rouding for instance the curve point indexes, or the curve height (Z). $\endgroup$
    – lemon
    Dec 4, 2023 at 19:00
  • $\begingroup$ just an idea: you can also control the rotation using the curve tilt (+ what we said above) $\endgroup$
    – lemon
    Dec 4, 2023 at 19:06

3 Answers 3

7
$\begingroup$

Perhaps you could get a nice result with just one Noise Texture with the right settings, but I find it easier to reason about multiple separate noise textures:

  • First a noise texture giving a basic profile to the stack, low scale for smoothness (actually very low, because I use Index as coordinate, and indices tend to be bigger than position components) and no roughness/detail for the same reason; consider some minimal distortion for uneven profile.
  • Then noise with slightly bigger scale to add some more chaos with local shifts of the stack; plus some distortion, so the shifts vary in size.
  • Add them together:

  • Voronoi texture is good for sudden boundary changes, but you could achieve similar by posterizing (snapping) a normal noise texture. This simulates big shifts of the stack. If you want to instead simulate joining separate stacks together, you need to use the voronoi cell position as the base for the coordinates for all other noises!
  • A white noise can be added to slightly move all cards randomly, however another noise with much bigger scale and/or roughness works more realistically, because in reality cards will tend to line up.

The setup then becomes:

And the stacks (the 2nd with all offsets scaled down for a more subtle effect):

One non-realistic thing here (the continuity across voronoi boundaries could be considered another) is that all cards centers stick to $xy = 0$. You could use the same noise textures (or transform them e.g. using other noises) to also offset the cards slightly.

$\endgroup$
2
  • $\begingroup$ Thank you so much for the effort and the detailed explanation! It's an excellent solution and incredibly helpful; I truly appreciate it. I'm marking your response as the answer because it provides the most comprehensive solution. I do have one remaining question: for some reason, in my Blender, the Voronoi Texture node has fewer input fields than shown in your screenshot. I only have Scale and Randomness, whereas in your screenshot, there's also Detail, Roughness, and Lacunarity. Could this be due to the Blender version? Or do I need a specific add-on? I'm using Blender 3.4.1. $\endgroup$
    – newbie
    Dec 5, 2023 at 12:28
  • 1
    $\begingroup$ I used Blender 4.0 for this answer, but you should have similar results with 3.4.1. $\endgroup$ Dec 5, 2023 at 16:24
6
$\begingroup$

Basically, you need to rotate and translate the instances using a noise texture. I found that tweaking the pivot of the rotation helps. The result looked good, but was missing something.

In the reference, it seems that the cards tend to clump together; a group of them roughly rotate together by the same amount. To replicate that, I posterized the noise using a Color Ramp (because it seems that the posterize node only exists in the Compositor). I ended up mixing the original noise with the posterized version.

A clamped noise texture produces values between 0.0 and 1.0. Typically, we subtract 0.5 and multiply by 2.0 to move the values to the -1.0 to 1.0 range. Then, we can scale the values up or down according to our needs. I combined the latter two steps in my setup.

Note that the rotation should only be around the z-axis, so I multiplied the x and y components of the noise output by zero. On the other hand, the translation should be limited to the x-y plane. Multiplying the z-component by zero does the trick.

The rest is to tweak the values to get something that looks good.

A screenshot showing the final node setup and the result is attached below.

Stack of Cards

There is an issue with my setup. I shouldn't have used the Factor output from the noise as a vector. This will cause all components to be the same.

$\endgroup$
2
  • $\begingroup$ Thank you! I'll try to play around with these Color Ramp node and see what comes out of it. $\endgroup$
    – newbie
    Dec 5, 2023 at 15:28
  • 1
    $\begingroup$ You're welcome! $\endgroup$
    – Mr A
    Dec 5, 2023 at 17:38
4
$\begingroup$

You can play with the Voronoi texture node to get different results. All you really need from my node tree is the Set Position, Combine XYZ and Voronoi Texture nodes.

screenshot of node tree and result

$\endgroup$

You must log in to answer this question.

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