Gradient to a Sphere and Rotate


(Paul) #1

This seems like it should be simple. I want to apply a gradient to a sphere and rotate the gradient to a desired position.

I applied a gradient texture node (linear) to a color ramp and then to a diffuse shader. No problem there, but I can’t rotate it. It’s stuck on the the x-axis. Other gradient types (quadratic, etc.) don’t cover the whole sphere. I’ve tried texture coordinates, mapping nodes, and math nodes, but no luck.

Has anyone ever tried this successfully?

Thanks for any help.


(cgCody) #2

First, I see you’re referencing coordinates from another object in the texture coordinate node. What are you trying to do there? Anyway, even with that being the case, it should work fine so long as you have the nodes connected correctly.

And I assume you had the texture coordinate node plugged into mapping, which is plugged into the gradient node? What type of mapping from the tex coord node? What happens when you rotate Y or Z (X will do nothing)?


(BluePrintRandom) #3

Geometry - position Node vector math node - subtract (object info node location) - transform - world - local - gradient input


(BluePrintRandom) #4

(cgCody) #5

Am missing something here, or did you mean to respond to a different thread? OP wants to simply rotate the gradient. This only requires two nodes as I previously explained. :slight_smile:


(Paul) #6

Thank you both. Vector Math FTW! I reassembled my nodes with Vector Math and was able to rotate with Mapping. Was trying to rotate with a reference! object. Thanks again!


(BluePrintRandom) #7

I see, I thought he was trying to rotate the object without the gradient staying in place