Jump to content

Pivot at the bottom of an object


Recommended Posts

Hej guys- I am looking for a way, to move the pivot of a "transform node" to the bottom of the of an animated! geometry.

 

What i tried:

 

image.thumb.png.270c24df497ed81f44e3c053268422c1.png

 

It's working, but only in the first frame - since my object is moving the left - the pivot don't move with the sphere. 

 

image.thumb.png.86c72147a2d5c9cfae72e4d0f11423c9.png

 

Any ideas?

 

Best jack

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Write this into your pivot translate to get the minimum y position of the input geo:

bbox(opinputpath(".", 0), D_YMIN)

opinputpath(".", 0) gets the path of the first input of the current node. https://www.sidefx.com/docs/houdini/expressions/opinputpath.html

bbox() returns the bounding box info of a node, in this case we want to use "D_YMIN" to get the minimum y position. https://www.sidefx.com/docs/houdini/expressions/bbox.html

 

edit: forgot to add the centroid expressions for the x and z values, see Tomas' reply below

Edited by markingleukc
Link to comment
Share on other sites

what you are doing with your bbox(0, 1) in Y is just making sure that your pivot's Y coordinate has the same value as the bottom of the geo

however since your animation seems to be in XZ plane, Y doesn't change therefore pivot will not move

you can put following expressions to px | py | pz: centroid(0, 0) | bbox(0, 1) | centroid(0, 2)

to center pivot in XZ and move to bottom in Y 

Edited by anim
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...