anicg Posted May 5, 2019 Share Posted May 5, 2019 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 Quote Link to comment Share on other sites More sharing options...
mald Posted May 5, 2019 Share Posted May 5, 2019 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 Quote Link to comment Share on other sites More sharing options...
anicg Posted May 5, 2019 Author Share Posted May 5, 2019 (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. Edited May 5, 2019 by anicg Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 5, 2019 Share Posted May 5, 2019 Hi mani, you might find this useful, as well: Quote Link to comment Share on other sites More sharing options...
mald Posted May 5, 2019 Share Posted May 5, 2019 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. 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 Quote Link to comment Share on other sites More sharing options...
anicg Posted May 10, 2019 Author Share Posted May 10, 2019 (edited) Thank you. I guess for a box it would be ch("sy") instead fo ch("rady") Edited May 10, 2019 by anicg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.