Jump to content

bbox (beginner question)


anicg

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

Link to comment
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

Link to comment
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 
Bad parameter reference: "rady" in parameter /obj/geo1/transform1/t. 

bbox2.JPG

Edited by anicg
Link to comment
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

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...