Affect color by another object bounding box in vex

   1597   6   1
User Avatar
Member
55 posts
Joined: April 2019
Offline
I have a colored grid that I want to affect area of the grid covered by an another object bounding box to have less intensity, meaning masking the grid color by another object bounding box. How can I go about doing this in a wrangle node which I'm using to color the grid?
Edited by YasinH - June 7, 2019 08:44:35

Attachments:
Screen Shot 2019-06-07 at 5.03.53 PM.png (719.0 KB)
Screen Shot 2019-06-07 at 5.09.44 PM.png (110.6 KB)

VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Here's something that might interest you.

Attachments:
Bounding_Box_Color_Control.hiplc (89.0 KB)

User Avatar
Member
55 posts
Joined: April 2019
Offline
Interesting! I thought it could be easier to do it in vex. Something like this sort of does the trick but it shifts the mask to one of the box vertices, not from the center!

v@myP = point(1,"P",0);
@Cd = fit(xyzdist(1,v@P-v@myP),0,5,1,0);

Also in your scene, I found an issue when scaling the cube.

Attachments:
Screen Shot 2019-06-07 at 7.24.39 PM.png (757.8 KB)

VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
“..easier to do in vex..”
Not sure what you mean by that.

I put in a different version for better ramp controls.(for my liking).

Could add something to take care of what you consider scaling issue. But what is the issue?

The image your showing is because the face of the cube is getting near the surface of the grid.

If you don't want that, sounds to me you just want to use the ‘slice’ of the object where it intersects the grid,

which is easy enough to change.(which I haven't done in this hip attached - saw your posting after I came back)

But knowing what you really want in the end and/or how you want the input used is hard to make the tool.
Edited by BabaJ - June 7, 2019 13:34:47

Attachments:
Bounding_Box_Color_Control1.hiplc (150.5 KB)

User Avatar
Member
55 posts
Joined: April 2019
Offline
Yeah, this is more like what I had in mind after tweaking the controls. Thanks for the help.
Sorry my question may have not been clear enough.
‘slice’ of the object where it intersects the grid,
Correct! Basically, the other object volume acts as a mask on the grid (dark in the object center, and getting whiter the closer it gets to the intersection border)
VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
I guess this is what you wanted?

edit: ok you posted before I saw you. This example is more simple, but it can't lesson the boundary of the mask - which is what I was trying to do with previous versions.

But if you like the previous version you can also try changing this part:

Center = getbbox_center(1);

to

Center = getbbox_center(1);
Center.y = 0;//keeping in mind this is the y of the grid. Change the grid y and you have to change this

This will eliminate whether the box is moving up or down in the y axis. Just note the results change abruptly if the box clears the grid altogether.
Edited by BabaJ - June 7, 2019 14:28:33

Attachments:
Bounding_Box_Color_Control2.hiplc (88.4 KB)

User Avatar
Member
55 posts
Joined: April 2019
Offline
That's it! It just needs to get blurred to mimic the fade off on the edges. Thanks a lot!
VFX Supervisor | CG Artist

http://yasinhasanian.com/ [yasinhasanian.com]
  • Quick Links