How to use point normals to align geometry copies?

   3802   2   1
User Avatar
Member
2 posts
Joined: Dec. 2016
Offline
Hello. I'm a beginner in Houdini and I'm following the procedural modelling courses on GameTutor.com.
In the Expression Bridge course, it doesn't cover how to make the horizontal bars that lie between the bridge towers. (See attached image)
I tried doing it myself and I've been able to copy the bars and stamp inputs to vary the scale.
However, I'm not able to figure out how to align them to the point's normal.
I have tried extracting the point normal and making it a detail in an attribute create, then using that in as a stamp input and then passing it to a transform rotate, but I can't seem to get the required result.
I think I might be extracting the wrong data. How do I align the bars to the point normal?

I've attached both the .otl and the .hipnc files. The part I need help in is in the right most part of the graph in a yellow netBox named HorizontalBars.

Any help is appreciated.
Thanks a lot.

Attachments:
ExpressionBridge.hipnc (535.4 KB)
Expression_Bridge.otl (46.3 KB)

User Avatar
Member
118 posts
Joined: Feb. 2016
Offline
Hello, I think you should play with the UP vector, whose attribute in houdini is named “up”.

I've hardcoded the UP vector to {0,1,0} and now it's better (no crazy orientations) but still not perfectly aligned.
You should try to find a way to calculate it for every piece, I guess.

Probably there's some super simple trick which I'm not aware of because I'm a newbie too with houdini.

Cheers

Attachments:
ExpressionBridge.hipnc (543.9 KB)

User Avatar
Member
2 posts
Joined: Dec. 2016
Offline
Thanks a lot for your help. However, I spent a few hours trying various things and I realised that I was reading the point normals correctly, but I hadn't aligned the original box to the X-Axis. And I had turned off Transform according to point attributes. So even though the data was passing through correctly, I just wasn't using it. It now works as intended.

Thanks again.
  • Quick Links