2
$\begingroup$
  • The Object Info node gives me access to the location of the shaded object('s origin) in World Space
  • The Texture Coordinate node gives me access to the coordinates of the shading point in the Object Space of any object.

How in a shader tree, could I retrieve the location of the shaded object in another object's space? For instance, the location of the shaded object in its parent's space?

Somehow apply the parent's inverse transform to the Object Info > Location?

$\endgroup$
  • 1
    $\begingroup$ Subtracting Combine XYZ (drived with parent world coordinates) from Object Info - is not what you are looking for? $\endgroup$ – Serge L Mar 11 at 5:56
  • $\begingroup$ @Serge L That is a partial solution, yes, as long as you can be sure that only translations are involved? Maybe the best that can be reached conveniently. It just seems odd to me that location isn't available in other bases.. you could do it in OSL, I think, if Cycles had it fully hooked up.. you could get to the transformation matrices of named objects.. but I don't think it's there, in the Cycles implementation. $\endgroup$ – Robin Betts Mar 11 at 6:23
  • $\begingroup$ @Serge L maybe rotations are all that screw it.. by taking the transformed 0,0,0 and 1,1,1 you could deal with translation and scale... $\endgroup$ – Robin Betts Mar 11 at 6:40

Your Answer

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

Browse other questions tagged or ask your own question.