3
$\begingroup$

When using geometry nodes to distribute points across an object, and then instance those points with another object (i.e. the Point Distribute and Point Instance nodes specifically), how can you rotate the instanced object around just one axis?

To put it another way - each instanced object appears (to me) to inherit its initial rotation from the normal of the source object over which the points are scattered (so instanced objects are always pointing Z up from the surface of the source object). I want to keep the X and Y rotation that the instanced object inherits, and just randomise the Z rotation.

This is the first thing I tried. This randomises the Z rotation, but sets X and Y to 0. I want to retain the current values of X and Y, and just randomise Z, but I don't see how to do that:

Attribute Randomise example

Then I thought I was very clever coming up with this. The problem here is that the output of the Random Float node always seems to be the same number, so the Z rotation is always the same for every particle instance. I want a random Z value for each instance:

enter image description here

Is there a way to actually do what I want at the moment?

$\endgroup$
2
  • 2
    $\begingroup$ I gave an answer here which might soon be outdated as I state there, since there seems to be a change in the coming Blender 2.93 version: blender.stackexchange.com/questions/213915/geometry-nodes-align/… $\endgroup$ Mar 26, 2021 at 8:20
  • $\begingroup$ @GordonBrinkmann That's not quite the issue I had here, but is an interesting point in its own right. Thank you for the link as this is very good to know. $\endgroup$
    – Lewis
    Mar 26, 2021 at 10:11

2 Answers 2

11
$\begingroup$

Using Attribute Randomize you are able to create a new attribute, instead rewriting the existing one. Then use attribute math to add a random vector to the existing rotation.

Another useful node is point rotate, it has the ability to rotate instances in local and global coordinates: enter image description here

$\endgroup$
5
  • $\begingroup$ Thank you. That example works, but to get the result I wanted I had to change it from "Object" to "Point" on the Point Rotate node $\endgroup$
    – Lewis
    Mar 26, 2021 at 9:37
  • $\begingroup$ Yep, this is exactly what I said, you can change orientation from local(point) to global(object) $\endgroup$
    – Crantisz
    Mar 26, 2021 at 11:07
  • 1
    $\begingroup$ Those nodes does not exists anymore in 3.1. $\endgroup$
    – gordie
    Mar 31, 2022 at 14:21
  • $\begingroup$ @gordie this answer is one year old. $\endgroup$
    – Crantisz
    Mar 31, 2022 at 14:24
  • 2
    $\begingroup$ @Crantisz I know - but the question is still valid and people like me are reading this topic and its answers today :) It would be nice to edit the answer or to post a new one; if someone has one. $\endgroup$
    – gordie
    Mar 31, 2022 at 21:42
7
$\begingroup$

As at Blender v3.0, you can use the Random Value Node as a generator for the attribute that you want to randomize.

Randomized rotation for instance points

In this case I was using the Instance on Points Nodes Rotation attribute. Otherwise, you can utilize the Rotate Instances Node at any point of the flow. If you want to randomize along a specific axis, use the Combine XYZ Node to separate the axes as in the image. I guess repeating the node connections would provide a myriad of ways that the instances could be rotated.

$\endgroup$
1
  • $\begingroup$ Hi! I'm looking for a replacement of previous Attribute Randomize node. Unlike that one, your solution sets the same random value for each instance on points... Is it possible to make random value for each instance?? $\endgroup$
    – AivanF.
    Jul 6, 2023 at 22:09

You must log in to answer this question.

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