# How to randomly rotate the texture of instances when the node "Geometry" is used?

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.

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.)

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:

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:

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

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.)

## 2 Answers

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.

• Thanks for your answer! Tweaking the scale can not 100% solve the problem, and my question has been updated. Commented Oct 17, 2023 at 10:37
• You're showing a completely different pattern in your update. Which one do you want to achieve ? Stripes, or something else ? Commented Oct 17, 2023 at 11:08
• I've added a second proposal, assuming what you want is stripes Commented Oct 17, 2023 at 11:15
• 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. Commented Oct 17, 2023 at 20:08
• Well here you are Commented Oct 17, 2023 at 20:16

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.