0
$\begingroup$

Plane is simply rotating on Z axis around origin from 0 deg to infinity (linear interpolation), AN extracts this rotation from polygon. Extracted motion looks fine but it isn't calculated as cumulated/continuous value. Every 180 degrees it is switching sign from + to -.

Look at Z value here:

enter image description here

Can this rotation be recalculated to match input motion? I was planning to change some values inside material in [0-1] range using growing angle, but unable to do it with current behaviour.

$\endgroup$

1 Answer 1

0
$\begingroup$

This signed representation is called a Directed Angle. To convert that to a non-directed angle, simply add $2\pi$ if the result is negative as follows:

Node Tree

This is assuming you angles are in radians, if they are in degrees, you should be adding 360 instead.

$\endgroup$
2
  • $\begingroup$ Good to know it has a proper name. So, to go beyond 360 I should store every negative appearance and add another 360? Or is there anything easier than that? $\endgroup$
    – Serge L
    Mar 25, 2019 at 19:04
  • $\begingroup$ @SergeL Take the modulo with the maximum range, $\pi$ or $2\pi$ depending on when you perform the modulo. $\endgroup$
    – Omar Emara
    Mar 25, 2019 at 19:12

You must log in to answer this question.

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