Community
Arnold for Houdini Forum
Rendering with Arnold in Houdini and Solaris using the HtoA plug-in.
cancel
Showing results for
Show  only  | Search instead for
Did you mean:

## How to rotate UV projection with matrix

3 REPLIES 3
Message 1 of 4
490 Views, 3 Replies

## How to rotate UV projection with matrix

Hi, I am trying to project an image taken from a chrome ball onto geo to turn it into a mesh light. I have read the docs but do not understand how to rotate the ball by degrees in the projection of X, Y and Z to line the image up with the geo Which values are which in the matrix shown in the docs? https://docs.arnoldrenderer.com/display/A5AFHUG/UV+Projection Any help would be great.

3 REPLIES 3
Message 2 of 4

The Arnold and OSL matrix is a 4x4 matrix.

You read it like a book, from left to right.
You can interpritate it as 4 vec4 structs.

RGBA
RGBA
RGBA
RGBA

Although they are infact just floats all together sitting on a string.

X
Y
Z
W

So typical rotation would look something like...

matrix ( cos(a), sin(a), 0, 0,

-sin(a), cos(a), 0 ,0,

0,0,0,0,

0,0,0,0);

So you just fill in the 2 first slots in the first to lines so to speak.

And you use the 2 math nodes cos and sin for the float value you are going to use as the driver for spinning it around on the U and V space. Dont forget to add a negative node for the second sin function.

With cos and sin you level out the fact that we sample a point on a circle which has exponential factors attached to it as we get closer to either 0 or 1 on both axis. And so the result will then be that if you pipe a linear increasing float value through "a" the rotation will be steady and linear.
Now you can spin it around any axis you want.

Message 3 of 4