1
$\begingroup$

I'm currently trying to get a series of spotlights to change colour based on the corresponding texture they are mapped from.

In this case i'm trying to reference the "grid" object so that when I move the spotlight it will align with the colour above (as seen in the blue light)

I've enabled the grid as the reference object on the texture coordinate node but am unsure of what mapping type to put on the mapping node or whether I need to scale it.

any help would be greatly appreciated thank you :)

link to model: https://drive.google.com/open?id=1IeGsIcqmSVdlrpjDVLoAadxS1kyiT7O8

enter image description here

$\endgroup$
1
$\begingroup$

A simple setting to do that can be (have added empty at the spot location so that we can see them through the grid):

enter image description here

In this setting, all lamps have the same node tree.

But few conditions to make it work:

  • The grid origin is a bottom left corner, seeing it from top (3D cursor location in the image below): we want the position to map from 0,0.

  • The base grid dimension is 1x1 (here it is scaled as you want but the base mesh is one by one): we want the dimensions to fit 1x1 UvMap

enter image description here

The UV map orientation corresponds to the object base orientation (rotating the UV map was needed, starting from your file):

enter image description here

The default 'object' output from the texture coordinates is 'world to object', so the vector transform node is not needed here. The input is 0>1 without this node, because the lamp position is converted to the grid position in its inner coordinates which is 0>1 (as the base grid is 0>1 without scaling).

Though, if you want the grid to have its own inner dimensions different from 1x1, you can add the following, where the 'value' node has the grid dimension (without scaling):

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.