5
$\begingroup$

I am trying to control the direction of the sun on sky texture with an empty, I set the direction of the sun controllable by the rotation of the empty with drivers, each axis corresponding to the XYZ direction of the sun, but the result is not behaving as expected.

$\endgroup$
10
  • 1
    $\begingroup$ why not simply parent the sun to the empty? $\endgroup$ Commented Jun 23, 2015 at 20:39
  • 1
    $\begingroup$ @TARDISMaker The sun is not an object, it is generated by sky texture node. $\endgroup$
    – Denis
    Commented Jun 23, 2015 at 20:40
  • $\begingroup$ Oh, okay, sorry. I didn't read your question carefully enough. $\endgroup$ Commented Jun 23, 2015 at 20:41
  • $\begingroup$ Define 'not behaving as expect'. You know the drill, what is it doing and what are you expecting? $\endgroup$ Commented Jun 23, 2015 at 21:27
  • $\begingroup$ The sun should be in the direction of the empty arrow, right now it looks like the axes of the empty are not corresponding to the sun direction and the rotation of the sun direction with the empty is not cyclical, so I assume that the sun direction coordinates are different, Im still not sure where is the problem. $\endgroup$
    – Denis
    Commented Jun 23, 2015 at 21:37

2 Answers 2

5
$\begingroup$

Sun direction in the sky texture node uses values of normalized vector that can be taken directly from World Matrix.

X value - matrix_world[2][0]  
Y value - matrix_world[2][1]  
Z value - matrix_world[2][2]

enter image description here

$\endgroup$
0
$\begingroup$

My suggestion is to use "single property" variable types, especially for nodes. The x rotation driver would have a datapath of rotation_euler.x (or rotation_euler[0])

$\endgroup$
1
  • 1
    $\begingroup$ That wouldn't work because sun direction uses normalized vector, I already solved this problem and going to add the answer. $\endgroup$
    – Denis
    Commented Jul 27, 2015 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .