3
$\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$ Jun 23 '15 at 20:39
  • 1
    $\begingroup$ @TARDISMaker The sun is not an object, it is generated by sky texture node. $\endgroup$
    – Denis
    Jun 23 '15 at 20:40
  • $\begingroup$ Oh, okay, sorry. I didn't read your question carefully enough. $\endgroup$ Jun 23 '15 at 20:41
  • $\begingroup$ Define 'not behaving as expect'. You know the drill, what is it doing and what are you expecting? $\endgroup$ Jun 23 '15 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
    Jun 23 '15 at 21:37
3
$\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
    Jul 27 '15 at 17:39

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.