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.
Asked
Active
Viewed 2,358 times
5
-
1why not simply parent the sun to the empty? – TARDIS Maker Jun 23 '15 at 20:39
-
1@TARDISMaker The sun is not an object, it is generated by sky texture node. – Denis Jun 23 '15 at 20:40
-
Oh, okay, sorry. I didn't read your question carefully enough. – TARDIS Maker Jun 23 '15 at 20:41
-
Define 'not behaving as expect'. You know the drill, what is it doing and what are you expecting? – Ray Mairlot Jun 23 '15 at 21:27
-
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. – Denis Jun 23 '15 at 21:37
-
The sun direction is defined as a normal direction, not sure how to convert euler rotations to a normal though :/ Related: http://blender.stackexchange.com/a/10577/599 and http://gamedev.stackexchange.com/q/82170/45856 (I've tried this before too :P) – gandalf3 Jun 23 '15 at 22:03
-
@gandalf3 So as I expected the values of the rotation are from 0 to 1 – Denis Jun 23 '15 at 22:24
-
@Denis AFAIK they are from -1 to 1 – gandalf3 Jun 23 '15 at 22:40
-
@gandalf3 yes using quaternians. In the related question you added the node setup doesn't work because when I change normal vector input it rotates the sky texture and not the direction of the sun separately. – Denis Jun 23 '15 at 23:02
-
@Denis Right, you have to control the sun direction with drivers. The normal input rotates the sky texture as you said. – gandalf3 Jun 23 '15 at 23:10
2 Answers
0
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])
batFINGER
- 84,216
- 10
- 108
- 233
-
1That wouldn't work because sun direction uses normalized vector, I already solved this problem and going to add the answer. – Denis Jul 27 '15 at 17:39


