Results 1 to 14 of 14

Thread: Gradient question, stepped gradient question

  1. #1
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553

    Gradient question, stepped gradient question

    I'd like to assign color to boxes based on their height. "Y-distance to pivot point" almost works, but it assigns all of the colors to the sides. Is there a way to color the entire box based on box's top-surface color? I've attached an image which shows the tallest box having a red top, the next tallest, yellow. Is there a way to get the red-topped box to be entirely red, and the yellow-topped box entirely yellow, etc., instead of having a gradient on the side surface?

    Related: When a gradient is controlled by spline, the colors are smooth. When it's changed to stepped, there are only a few steps. Is there a way to numerically add steps? (eg 50?)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	question LW color.jpg 
Views:	80 
Size:	37.7 KB 
ID:	120187  

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,891
    Make weight map with 100% on top four points, and 0% on bottom four points (or reverse). Then use weight map instead of Y axis as input to gradient.

    - - - Updated - - -

    Quote Originally Posted by medicalart View Post
    Related: When a gradient is controlled by spline, the colors are smooth. When it's changed to stepped, there are only a few steps. Is there a way to numerically add steps? (eg 50?)
    You would need to quantize input prior plugging it to Gradient node.

  3. #3
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    [QUOTE=Sensei;1367972]Make weight map with 100% on top four points, and 0% on bottom four points (or reverse). Then use weight map instead of Y axis as input to gradient.

    - - - Updated - - -

    The weight map for gradient does not appear to solve the problem. I don't want the gradient on the box. I am trying to capture a solid color, based on the height of the box, in relation to the gradient. In other words, the tallest box would be colored red (the highest value on the gradient); and the shortest box would be colored green (the lowest value on the gradient). In between sizes would be various colors, depending upon their position on the gradient.
    Am I doing something wrong? Any ideas? thanks.

    The gray photo shows my result. The white photo is the original photo. Arrows indicate an example of the solid color derived from the gradient.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	gradient question 03.jpg 
Views:	38 
Size:	16.8 KB 
ID:	120202   Click image for larger version. 

Name:	question LW color.jpg 
Views:	40 
Size:	37.7 KB 
ID:	120203  

  4. #4
    Yes, you are applying the weightmap to each box individually instead of the trio. Another approach would be to use Y distance to object, as your gradient imput, now make sure your object sits at 0. The advantage of using this instead of weightmaps is that you can set it to world coords and animate the bars with a morph and the gradient stays in place as the bar grows.

  5. #5
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    I tried the weight map as a trio, and individually and got the same result. Also tried your suggestion of Y distance to object and that didn't work, either.
    The top of the boxes are then correct, but the sides show a gradient instead of a solid color. Is there a way to get a solid color onto the sides of the bars? I had used the "Y distance to pivot" to generate the image with the arrows.

  6. #6
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    Quote Originally Posted by Sensei View Post

    You would need to quantize input prior plugging it to Gradient node.
    I don't see a quantize node. Is there a quantize node that can be used to add a number of keys to a gradient? None of the numeric ones work. Thanks.

  7. #7
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,072
    It's a very strange request, why can't you just give each box it's own surface?

    Anyway....



    Click image for larger version. 

Name:	Col_By_Height_Lrg.jpg 
Views:	42 
Size:	268.0 KB 
ID:	120207

  8. #8
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    Thanks for the node instruction XswampyX. I would like to give each box it's own surface, but there are too many (2,000 boxes and 200 surface textures required).
    I've used a UV map, but I think your gradient node set-up will be better.

  9. #9
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,891
    Quote Originally Posted by medicalart View Post
    I don't see a quantize node. Is there a quantize node that can be used to add a number of keys to a gradient? None of the numeric ones work. Thanks.
    You need to Multiply, then Floor then Divide by the same value as in multiply.
    f.e. 16.
    I will make video tutorial later.

  10. #10
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,891
    Quote Originally Posted by medicalart View Post
    Thanks for the node instruction XswampyX. I would like to give each box it's own surface, but there are too many (2,000 boxes and 200 surface textures required).
    Mine tool WeightPolygonGroups would solve your issue immediately.
    You would have different weight map value on each box.
    Then just retrieve it using Vertex Maps > Weight Map, and plug to Gradient node, then to Color.

  11. #11
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    Thank you for your suggestions.

  12. #12
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    Where does one find the node "Set Max Height"? (in XswampyX screen capture). I've looked through the node list several times and don't see it anywhere... Thanks.

  13. #13
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,072
    Quote Originally Posted by medicalart View Post
    Where does one find the node "Set Max Height"? (in XswampyX screen capture). I've looked through the node list several times and don't see it anywhere... Thanks.
    It's just a constant -> scalar set to '5' I think. I use them just to remind me what values I could change later on when I come back to the scene.

    Here's the scene... You might want to take the model over into layout and see the extra geometry that's needed to get the sides to render clean.
    And it's animated, just scrub the time line and you will see that it's all automatic.

    Cheers!
    Attached Files Attached Files

  14. #14
    Super Member
    Join Date
    Mar 2004
    Location
    Boston, M
    Posts
    553
    Wonderful. Thank you.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •