0
$\begingroup$

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: enter image description here

This is what I am seeing: enter image description here

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!

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – Chris
    Apr 13, 2023 at 14:28
  • $\begingroup$ 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 $\endgroup$
    – Ramon
    Apr 13, 2023 at 14:45

1 Answer 1

2
$\begingroup$

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

enter image description here

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:

enter image description here

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

$\endgroup$
5
  • $\begingroup$ Thanks, this makes the logs rotate individually. However, now they are not aligned anymore with the curve. gyazo.com/619478745aef6b59b21da22a7fac202e $\endgroup$
    – Ramon
    Apr 13, 2023 at 15:05
  • $\begingroup$ 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 $\endgroup$ Apr 13, 2023 at 15:19
  • $\begingroup$ 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! $\endgroup$
    – Ramon
    Apr 13, 2023 at 15:30
  • $\begingroup$ 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 $\endgroup$ Apr 13, 2023 at 15:55
  • $\begingroup$ This is great, Thank you for taking a look! $\endgroup$
    – Ramon
    Apr 13, 2023 at 16:05

You must log in to answer this question.

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