Basic Bounding Box Variable Question

   14929   4   0
User Avatar
Member
11 posts
Joined: May 2009
Offline
I am transitioning over from Maya and Max to Houdini with some small difficulty. My first Newbie question is about the Bounding Box variables:$BBX,$BBY,$BBZ. I understand from the help docs that it the position of the point with the objects bounding box. But, when I attach a point sop() to a grid and add the $BBX,$BBY,$BBZ to the point sop()'s position parameters, it scales down the grid. Also, 0.5 is the default value given. When I add a 1 to the $BBX, the grid translates by that value. Now, can someone explain to me in more detail what these variable a doing?

Thanks
:?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
$BBX returns the location of the previous SOPs geometry bounding box in X for the current point being processed by the Point SOP.

The bounding box values returned should be from 0 to 1 as the points being querried move from the left to the right of the bounds in X for the previous SOP`s cached geometry.

$TX + $BBX will add to the incoming points a value between 0 and 1 depending on where the points are located in the X plane again for the previous SOP`s cached geometry.

Using $BBX raw in the X position will completely override the incoming point positions to that of their location from 0-1 in the YZ plane (X direction). That is what you are getting. No matter how small or large the incoming geometry is, you will get values from 0 to 1 as a result.

Same for $BBY and $BBZ.

Why does Houdini show a value of 0.5? That's the value returned by the very first point processed by the Point SOP: Point number 0.

The Bounding Box values are usually used in noise(), snoise(), turb(), fit(), sin(), cos(), tan(), and other hscript expressions where you need to drive a procedural expression based on position.

—-

As for visualizing what is going on, here are some ways to help you.

Dump attribute in to a default Color attribute:
Why not try this. Type $BBX, $BBY and $BBZ in the three color fields in a Point SOP. You will now see varying colors from 0 to 1 for each of the three bounding field values.

Geometry Spreadsheet / Details View:
Dump the bounding box expressions in to a Point SOP color parameters then RMB (Right Mouse Button) on the icon for that Point SOP and open up the geometry Spreadhseet. It should default to Point attributes. Scroll over to the three color attributes and you can see the bounding box position for each point.

Viewport Display Options:
Dumping the bounding box in to color, you can actually see the three values right in the viewport. If the color isn't enough, you can add your own custom Attribute.
Steps
1. Hit the “d” key in the viewport to open the Display Options
2. In the Guides & Markers tab, go over to the Custom area, press the down arrow menu and choose “Create Attribute Text”.
3. RMB on the new added custom option (text1) and choose “Edit”
4. In the Edit Option dialog that popped up, change the following:
Name: bbox
Label: Bbox
Attribue: Cd
5. Press Accept to exit the Edit Option dialog
6. Enable the new custom attribute
done
Now in the viewport you can see the varying attribute values in the viewport.

Now why the great number of steps? Because I have seen some user scene files with over 40 custom attributes in this list! Control.

This should get you started in to visualizing attribute values and understand how to use them. Please have a look at the Expression Cookbook in the Help as it goes over a lot of examples.
Also look at the operator help for the Point SOP. Lots of examples using local variables to do interesting stuff.
There's at least one school like the old school!
User Avatar
Member
11 posts
Joined: May 2009
Offline
Ok, applying the custom attribute helped with my issue. My questions in the future will be many; rooting to the bare aspect of why this-why that.
I am totally convinced Houdini is the true creation of effects software.

Thank you very much
Paul
User Avatar
Member
1 posts
Joined: Dec. 2015
Offline
So I am super new to Houdini. I'm trying to find bounding boxes. So far I've only come across changing a box mesh into a bounding box is the correct path or is there a node?
User Avatar
Staff
3456 posts
Joined: July 2005
Offline
Kopyright Thirteen
So I am super new to Houdini. I'm trying to find bounding boxes. So far I've only come across changing a box mesh into a bounding box is the correct path or is there a node?

what exactly are you trying to do?
if you want to Display geometry as a bounding box you can look on the Render Tab for the Display As parameter
if you want to create a piece of geometry that is the bounds of another piece of geometry then you can use the Bounds SOP…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
  • Quick Links