Jump to content
Sign in to follow this  
anicg

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

bbox.JPG

Share this post


Link to post
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 this post


Link to post
Share on other sites
Posted (edited)
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 
Bad parameter reference: "rady" in parameter /obj/geo1/transform1/t. 

bbox2.JPG

Edited by anicg

Share this post


Link to post
Share on other sites
7 hours ago, anicg said:

Thanks, I get an error for the ch(rady): it says 
Warning 
Bad parameter reference: "rady" in parameter /obj/geo1/transform1/t. 

bbox2.JPG

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 this post


Link to post
Share on other sites
Posted (edited)

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

 

Edited by anicg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×