4
$\begingroup$

I'm trying to use drivers to allow a lamp rotation to dictate the direction of my normal node. The problem seems to be that the sun can rotate from 0-360 degrees, but the driver has a limit of 0-90 degrees, so the rotations do not match up. Is there any way around this? Thanks!

Screenshot:

$\endgroup$
6
$\begingroup$

This is a bit tricky, since the value range of the normal vector is (-1, 1). But you appears to control it by object rotation, which circle range is from 0° to 360°. It doesn't make any sense to add drivers between them.

You can use Mapping node to control the Normal vector output, driven by the object rotation (in degrees or radians). However, Blender internally uses Radians instead of Degrees, that's why you'll see the driver value shows in both radian and degree system.

So, you need to do some radian calculation for the driver expression. In this case, on the newly added Normal node (with the "control ball" UNTOUCHED), you need to add/subtract a half circle for it, which equals pi.

enter image description here

Example file:

| improve this answer | |
$\endgroup$
  • $\begingroup$ The file has been deleted. Could you please re-upload? Also the formula here is very small and I cannot read it. $\endgroup$ – Pierre Schiller Apr 2 '18 at 5:26
  • $\begingroup$ @PierreSchiller It actually lost... I just re-made it for you. $\endgroup$ – Leon Cheung Apr 3 '18 at 8:34
  • $\begingroup$ Thank you so much. So now it's downloadable again? Also, If I rotate the empty, the normal shading on the ball will change. But what if I turn the ball away from the empty? Will it detect the change from its current position to the empty's position? $\endgroup$ – Pierre Schiller Apr 3 '18 at 13:23
  • $\begingroup$ I didn't add the visual axis mesh, which was intended for better visualization only, but you can still reference the widget. The drivers just control by the rotation, regarless the distance or position. But I think you can do that with driver in a different setting. $\endgroup$ – Leon Cheung Apr 3 '18 at 15:12
  • $\begingroup$ Oh man, it broke. The file is not working on current Blender 2.79b (daily dev). $\endgroup$ – Pierre Schiller Nov 7 '18 at 21:20

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.