Object level: keep a grid 1 unit below rotating cube

   2222   2   1
User Avatar
Member
130 posts
Joined: April 2009
Offline
Hello Everyone,

Let me ask you for help with something that looks extremely easy, yet I got totally stuck trying to find a simple way forward.

I have two objects, a cube and a grid 1 unit below the cube. The cube is rotated *at sop level*, and I neeed the grid to always stay 1 unit below the lowest point of the cube. The two are inside different geometry containers.

How can this be most easily be done? My aim is to build the required functionality into the grid asset, so that I can give it an arbitrary geometry, and make sure it always stays within the required distance, when the other geo is animated.

I would appreciate some help with this issue.

Thanks,
Greg
User Avatar
Member
1922 posts
Joined: Nov. 2006
Online
You just need to build a bounding box around the rotating geometry and then transform your grid downwards based on the minimum Y value of that bbox and your desired offset. See attached:

You can object merge in your rotating geometry and plug it into the input of a Box SOP. This constructs a box completely encompassing your rotating geometry. If you use a bbox() expression to get the YMIN value you can then use it to transform your grid.

Attachments:
rotating_bbox_offset.hip (60.5 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
130 posts
Joined: April 2009
Offline
Hi Graham,

Thank you very much!

So simple!

Cheers,
Greg
  • Quick Links