bbox (beginner question)

Recommended Posts

It's quite a beginner question: how do I use bounding box information to let the sphere come exactly on top of the box, and the torus on top of both, in a way that when the size changes they all stay on top of each other. Thanks

Share on other sites

Hi anicg

If you start with all the objects at the origin then you need to move the sphere centre in Y direction using the expression  bbox("../box1", D_YMAX) + ch(rady). This moves the sphere on top of the box.

Then for the torus you need to move the torus centre in Y direction using  bbox("../sphere1", D_YMAX) + ch(rady).  This moves the torus on top of the sphere.

Thereafter, you can alter the y parameter of the sphere and torus and they will stay on top of each other.

Cheers

Mal

Share on other sites
1 hour ago, mald said:

Hi anicg

If you start with all the objects at the origin then you need to move the sphere centre in Y direction using the expression  bbox("../box1", D_YMAX) + ch(rady). This moves the sphere on top of the box.

Then for the torus you need to move the torus centre in Y direction using  bbox("../sphere1", D_YMAX) + ch(rady).  This moves the torus on top of the sphere.

Thereafter, you can alter the y parameter of the sphere and torus and they will stay on top of each other.

Cheers

Mal

Thanks, I get an error for the ch(rady): it says
Warning

Edited by anicg

Share on other sites

Hi mani,

you might find this useful, as well:

Share on other sites
7 hours ago, anicg said:

Thanks, I get an error for the ch(rady): it says
Warning

Hi anicg

I entered the expressions directly into the sphere and torus nodes ie. I dispensed with the transform nodes.  If you enter the expressions in the transform nodes you need to reference the original nodes rady parameters in the sphere and torus nodes.  At the moment you are trying to reference a rady parameter in the transform node(which doesn't have a rady parameter).  This is why you are getting the error message.   For example, you need to change ch(rady) in the sphere transform node to ch("../sphere1/rady").  Hope this makes sense.

Mal

Share on other sites

Thank you. I guess for a box it would be ch("sy") instead fo ch("rady")

Edited by anicg