position "gradient" should "normalized" to get 0-1 no matter what is the size or the position of the object

   1527   2   1
User Avatar
Member
75 posts
Joined: Feb. 2019
Offline
It's me again

i just noticed that my position parameter gives out different values depending on the position (and size of course) of the object
this sounds logical because P means position, but on the other hand i need a “linear gradient mask” (like pos Y should give out a gradient with value 1 on top, and value 0 on bottom) that is independent from changing of P vector (or better say, i need a P based gradient that always fits to 0-1 range).
I need that because i have “gradient masks” are controling intensity of displacement “effect” and such things.

now if i scale my cube 3 times my position based mask ranges are going crazy (i understand P is changing when i'm transforming (move, rotate, scale) a mesh, so i need some kind of range that “autolevels” (i know, i know) my range into 0-1.

so question is:
is there any node or whatever that makes automatically any position range fit into 0-1, so i can tweak that output with a “manual” fit range?

Thank You!
Edited by ostyascukor - July 17, 2019 07:37:15

Attachments:
pos_01range.jpg (359.1 KB)

User Avatar
Member
9380 posts
Joined: July 2007
Offline
Relative to Bounding Box VOP
Or relbbox() VEX function
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
75 posts
Joined: Feb. 2019
Offline
yes!
it just came in my mind there will be something with bounding box! (yeah, i'm a genius haha)

Thank You for the ultrafast and useful answer!
  • Quick Links