Results 1 to 15 of 15

Thread: Linear gradient following null position + heading?

  1. #1
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314

    Linear gradient following null position + heading?

    I'm having a little problem working this one out.

    I have a flat plane with a simple linear gradient applied to it. I want the gradient to follow the movement of a null around but also want the gradient to match the Heading of the null (ie so when the null rotates 30degs the gradients Heading also follows at the pivot of the null).

    I'm not sure of the maths here and how to combine it all into an end result. Can someone help?

  2. #2
    Hmmm, sounds pretty easy doesn't it: move/rotate gradient based on position/rotation null. But it seems to be not easy at all, even with nodes.

    Can't you bake the gradient to an image (or paint one) and use an image map? That should be easy to move/rotate with the null.

  3. #3
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    Hi Serge

    many thanks for your response. Yes your right, I'll try that approach. I was kind of using this as a little experiment on keeping everything generated in LW rather than go back and fourth to a 3rd party.

  4. #4
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    393
    Turns out it can be done....

    One null controls the rotation and limit of the gradient's blue key, the other one controls the limit of the gradient's red key.

    Not completely native LW, as it uses dpont's rotate node - still it does what you were looking for... And the cool thing is, because it's nodal, you can feed other images or textures into each key of the gradient.

    enjoy!

    Derek
    Attached Files Attached Files

  5. #5
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    Kyuzo, that's a bit special, massive thanks! I'll enjoy picking that one apart!

    Mark

  6. #6
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    393
    Then you'll love this one...

    Same idea, but uses the scale of the null in the x direction to determine the size of the blend area, with the middle of the blend centred on the null.

    A bit more user-friendly, and only uses a single null.

    As Han Solo famously said, "Y'know sometimes I amaze even myself..."

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Gradient Scale Null.jpg 
Views:	193 
Size:	32.2 KB 
ID:	81231  
    Attached Files Attached Files

  7. #7
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    humm, just getting a blue screen on that one. I'm a bit confused, should I be looking at the "Gradient" surface or the surface labeled "___"?

  8. #8
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    393
    Ah, I think the nodes lost it's link with the null when I saved it.
    The surface is the one called gradient, and make sure that the node for NULL_CENTER is referencing NULL_GRADIENT.

    Derek

  9. #9
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    Ha! Got it... nearly there - the scale part isn't working and I can't see any ref to scaling in the setup?

  10. #10
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    393
    Ohhh.. just realised... I resaved the scene, but not the object... which obviously has all the surfacing info in it. What a numptie.
    Try this updated file!

    Derek
    Attached Files Attached Files

  11. #11
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    Don't hate me, it looks identical to the last one! Can you re-attach?

  12. #12
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    393
    Don't worry, I don't hate you...

    try these...
    Attached Files Attached Files

  13. #13
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    This is so appreciated, better than what I was after! Many thanks kyuzo

  14. #14
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    393
    No worries, glad I could help.
    I love a good puzzle, and I'm just chuffed that I managed to crack it...
    Like Serge, at first I thought it was gong to involve some silly mathematics, so three cheers for dpont and his great nodes!

    Derek

  15. #15
    Big fan of coffee raw-m's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,314
    hipPip... and that they work on a mac!

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
  •