Sine node in material editor gives unexpected results
I'm trying to input degree angles in function. I convert the value to radians ( rad= deg/180 *pi). It seems to work correctly when the result is used as input for a cosine node, but not for a sine. As shown in the picture, cosine gives me "expected results" when passing from 0° to 180° ( white, grey, black, well... at 180° I'm expecting -1 as result, so a black color will be right... but I have white) but I can't say the same things for the sine node... In fact, trying to obtain x,y coordinates of a versor I have a wrong vector. Am I missing something or there is a strange bug in the sine node?
Ok... I've found the answer by myself... :) The sine and cosine nodes have a default period = 1. To obtain usual "geometric" values it needs to be changed to 2pi... With this adjustment all the values are correct. Ah, trigonometry... old friend :)
answered Aug 12 '14 at 09:18 AM
The doc says the input is in radians, it is not true.
Imagine if you want a friendly 30 or 45 degrees.
If the input is in radians, the input should be: Pi x 30/180 = Pi / 6 = 0.524 radian. For 45 degress: Pi x 45/180 = Pi / 4 = 0.785 radian.
But actually you need to input: 30 / 360 = 1 / 12 circle. For 45 degress: 45 / 360 = 1 / 8 circle.
Conclusion: The input is in a fraction of a circle.
The legacy Rotator is in range: 0 ~ 65535, converting to 0 ~ 1 is easy so the input of sine is 0 ~ 1?
The documentation is wrong on this (https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ExpressionReference/Math/index.html#sine)
It said the input is in radians (as you would expect), but as other have stated before, it seems to be in radians/PI. Meaning an input of 1 is actually an input of PI radians...
Fix documentation, or fix the input type of the sine node please,
answered Oct 05 '15 at 12:20 PM
Bump!! How can Epic not have corrected this yet?!
answered Oct 23 '15 at 03:32 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here