Color ramp on a polygon

   4989   4   1
User Avatar
Member
61 posts
Joined: Dec. 2005
Offline
Trying to get a color ramp across a rectanglular polygon,
Where the center is white and the edges are red.
I'd like to them base the red's thickness based on polygon size.
Should I be diving into VEX to accomplish this.
Thanks!
~Shawn
Touch Designer User
User Avatar
Member
61 posts
Joined: Dec. 2005
Offline
Because its a rectangle, I could try a bounding box
or centroid, but would still want a look-up to a color ramp
of some sort.

~Shawn
Touch Designer User
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
vops would be the way to go imo

Attachments:
fopshawn.hipnc (69.6 KB)

.
User Avatar
Member
61 posts
Joined: Dec. 2005
Offline

(Edit: 1:44am 11/6/12)

Originally wanted to make the white portion square instead of circular, but I'm still failing at this.

Instead, I was thinking I could make the circle look better on a rectangle if I could increase the short side (width or height) by the ratio between the two. This would stretch the circle into an oval to better match a rectangle instead of a square. Just not sure how to do this with distance. My attached file has the ratio ready but nothing to use it with. I think I need a smarter distance that adds overall height and width into account.

Thanks again for your help.
I understand the file better and where the color is coming from.

~Shawn

Attachments:
fopshawn_300.hipnc (81.4 KB)

Touch Designer User
User Avatar
Member
61 posts
Joined: Dec. 2005
Offline
I've figured out a way to stretch the white circle by expanding the Z point position by the height/width ratio of the rectangle. I can do this procedurally but if the rectangle is taller than wide, I'll need to set up an if/then or something to differentiate between the two. In this later case, it will be increasing the X point position. Not quite sure how to do this yet.

I'm trying to make this VOP SOP works for a set up random sized rectangles so they all have the same color fade no matter it's size. I think I'll need to take into account the area of each rectangle so I can multiply it by the Parameter, or Max Range in the Fit VOP. This way I can increase the color effect (more white than red) on all rectangle tiles (only working with one right now and will update this thread when it's working on a plethora).

Also, can anyone can figure out a way to make this a white square instead of a circle. I think I'll need a second vector instead of just the centroid used before the distance vop.

~Shawn

Attachments:
fopshawn_301.hipnc (96.0 KB)

Touch Designer User
  • Quick Links