# Geometry Nodes: rotate each instance individually after resampling curve

First off, I am new to geometry nodes and am trying to understand what is going on.

I think my setup and question is pretty basic but I can't seem to get it to do what I want.

So I want every log to get a random rotation on the x axis. Every log is 3 meters, so the curve is resampled every 3 meters. On every point on the curve, 10 points are added vertically. Then I am adding a log on every point and want to give them a random rotation.

This is my node setup:

This is what I am seeing:

As you can see, the rotation is random on 1 mesh line, but then identical to every new point on the curve (next mesh line).

How do I make it so every log has a random rotation?

Here is the .blend file

Thanks in advance!

• instead of 90 try pi/2 because blender expects radians instead of degrees. if this doesn't help, pls provide blend file so we do not have to rebuild everything on our own. Thx. Apr 13, 2023 at 14:28
• The amount of rotation does not matter for now. I just want to have every log to have an own rotation. I have included the blender file to the original post Apr 13, 2023 at 14:45

## 1 Answer

It's actually quite simple. You are stacking instances on instances. so the 3 vertical lines are actually one object just duplicated 3 times. What you need to do is place a realize instances node in between the two 'Instance on Points'. By that you turn the instances into mesh data and they start to act separately

Edit: You also need to change the Z rotation of each plank as the rotation of the instances before have been applied. I suggest to use curve to points node that gives you a tangent for each individual point you are sampling and align the plank according to them:

You can also get rid of the resample curve node at this point If you do not wish to make the original curve simplier

• Thanks, this makes the logs rotate individually. However, now they are not aligned anymore with the curve. gyazo.com/619478745aef6b59b21da22a7fac202e Apr 13, 2023 at 15:05
• The problem should be in the horizontal curve that defines the 3 points for vertical lines. Try recreating it as in the example I provided (in the GN from the beginning) and see whether that works. I had no such problem in the example. This way you'll know where to look Apr 13, 2023 at 15:19
• I am sorry, I know the problem is in the curve but I can't find the solution. In your example you are using two mesh lines and no curve as I am intending to use. Could you perhaps take a look in the example .blend file I provided in the original post? Thanks anyway! Apr 13, 2023 at 15:30
• Yeah it makes sense. By realizing instances you basically apply all transforms that happend to them before (including the rotation). What you need to do is rotate each individual plank not only along X axis as you wanted but also along Z-axis to align them with the tangent. Look into my answer, I'll put the script there Apr 13, 2023 at 15:55
• This is great, Thank you for taking a look! Apr 13, 2023 at 16:05