Translating a bounding box procedurally, aligning top to 0,0

   3449   3   1
User Avatar
Member
20 posts
Joined: March 2015
Offline
Hi,

Sorry for the silly question but I'm stuck. It's hard to describe what I want to do with words so I'm attaching an annotated screenshot.

Basically, I need to translate procedurally the wire in the picture so that the top point (A) is always at 0,0. The closest I could get is using the expressions you can also see in the picture. Y alignment works but X alignment is offset because if use bbox D_XMIN the “left-most” point (B) is not on top but around the middle of the wire. Hope this makes sense. Thanks!

Attachments:
HoudiniQuestionAnnotated.jpg (315.4 KB)

User Avatar
Member
8531 posts
Joined: July 2007
Online
you can for example subtract position of a point which you want to move to 0

Attachments:
stabilize_by_point.hip (116.5 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Sort node: Point sort by Y, reverse point sort.

Transform node:
Translate X: -point(0, 0, ‘P’, 0)
Translate Y: -point(0, 0, ‘P’, 1)
Translate Z: -point(0, 0, ‘P’, 2)

Attachments:
translate_to_top_point.hipnc (115.8 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
20 posts
Joined: March 2015
Offline
Thanks for your inputs. I ended up doing a variation of the sort + transform suggestion. It now works.
  • Quick Links