Vex - bbox color graident (new point node)

   4838   3   0
User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
Hello,
I am following a tutorial and a part of it shows how to use bounding box expression to make a color gradient using the old point sop. That's all fine but I want to make it work using the new point node, hence with vex. I have attribute set to color and I wrote relbbox(@P).y in the “VEXpression” area but that ignores my color and just makes a black to white gradient. If I write the expression in one of the color parameters for example red, the node defaults everything to black.
Edited by Thunderbeast - March 27, 2017 12:31:09
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
This node is not so intuitive the first time around
1. Either you can set Cd (or any of the other attributes) directly in the vexpression field like this:
set(relbbox(@P).y,0,0)
2. Or you can use the “Constant Value” as a sparse parameter to do math operations with:
value * relbbox(@P).y and setting “Constant Value” to 1,0,0. This is the same as saying: take the vector in “Constant Value” and muiltiply it with “relbbox(@P).y” If you want to change the color or animate it later on you wouldn't have to change your code, just the “Constant Value” directly.

Hopes this made a little sense.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
7794 posts
Joined: Sept. 2011
Online
The constant value has to be referenced to have an effect. Try:
value * relbbox(@P).y
User Avatar
Member
50 posts
Joined: Nov. 2016
Offline
Worked like a charm . Using value * relbbox(@P).y is much nicer and more intuitive.
Thanks a lot, and now to continue teaching my noobness more vex.
  • Quick Links