0
$\begingroup$

Here is the setup of the geometry nodes, where the random value is set up to randomly rotate instances along Y and Z axes. However, the screenshot shows that the texture of instances does not randomly rotate - only the geometry of the instances is rotated randomly.

enter image description here

This is because the node "Geometry" is used as shown below. (The deeper reason why the texture does not rotate is still unknown to me.)

enter image description here

My question: In this case, how can I make both the texture and geometry of the instances rotate randomly please?


By the way, if the node "Texture Coordinate" is used, then both the texture and geometry of the instances are indeed rotated randomly as shown below:

enter image description here

However, from the above screenshot, the texture for the bigger ball is over-stretched. I do not want the over-stretching, and I like the density of the texture from the node "Geometry".


Another note: Using the node "Mapping" can not 100% solve the problem. For example, node "Geometry" can generate this: enter image description here

It is almost impossible to generate the same thing by tweaking values on the node "Mapping": enter image description here


As the title of my question shown, I want to "randomly rotate the texture of instances when the node "Geometry" is used", so the texture can be anything - not only stripes from the "Wave Texture" but also other patterns, such as "Voronoi Texture". The goal is to randomly rotate the texture, independent of any specific texture pattern. (To illustrate my question, I have used stripes as just one example.)

$\endgroup$

2 Answers 2

0
$\begingroup$

You can insert a mapping node in between the texture coordinate and the wave texture and tweak the scale as needed.

As for an explanation of what's going on, you're trying to feed the normals of a mesh into the coordinate socket of a texture. Normals are just vectors pointing away from vertices/faces, they don't take object transforms into account.

$\endgroup$
5
  • $\begingroup$ Thanks for your answer! Tweaking the scale can not 100% solve the problem, and my question has been updated. $\endgroup$ Oct 17, 2023 at 10:37
  • $\begingroup$ You're showing a completely different pattern in your update. Which one do you want to achieve ? Stripes, or something else ? $\endgroup$
    – Hadriscus
    Oct 17, 2023 at 11:08
  • $\begingroup$ I've added a second proposal, assuming what you want is stripes $\endgroup$
    – Hadriscus
    Oct 17, 2023 at 11:15
  • $\begingroup$ Thank you for your second proposal! As the title of my question shown, I want to "randomly rotate the texture of instances when the node "Geometry" is used", so the texture can be anything - not only stripes but also other patterns. The goal is to randomly rotate the texture, independent of any specific texture pattern. To illustrate my question, I have used stripes as just one example. $\endgroup$ Oct 17, 2023 at 20:08
  • $\begingroup$ Well here you are $\endgroup$
    – Hadriscus
    Oct 17, 2023 at 20:16
0
$\begingroup$

Here is a different idea, not using the wave texture (it is not necessary since you're using a constant interpolation for your color ramp, so the sinusoidal shape the wave texture produces is lost anyway).

Here we're relying on the object coordinates, taking only the Y dimension, and feeding it into the same color ramp. In the process we're also

  1. scaling it (to control the size of the stripes),
  2. making it absolute (so that it mirrors on the other side of the ball),
  3. and wrapping it (so that it repeats indefinitely).

If you want you can also clamp it (clamp node) on top of that to make it stop after a certain point.

Stripes

$\endgroup$

You must log in to answer this question.

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