Skip to main content
yuriy_levchenko
Known Participant
April 4, 2018
Question

How to emulate skew axis animation?

  • April 4, 2018
  • 0 replies
  • 345 views

Hello,

I put an effect on the picture "ADBE Geometry2"

and set Skew to 20.0 and Skew Axis to 45.0 grad

get from script values

var skew_x = Math.tan(skew_value * to_digrees) * Math.abs(Math.cos(skew_axis_value * to_digrees));

var skew_y = Math.tan(skew_value * to_digrees) * Math.abs(Math.sin(skew_axis_value * to_digrees));
and setup my matrix

_m[0 * 4 + 0] = 1.f;

_m[0 * 4 + 1] = skew_x;

_m[0 * 4 + 2] = 0.f;

_m[0 * 4 + 3] = 0.f;

_m[1 * 4 + 0] = skew_y;

_m[1 * 4 + 1] = 1.f;

_m[1 * 4 + 2] = 0.f;

_m[1 * 4 + 3] = 0.f;

_m[2 * 4 + 0] = 0.f;

_m[2 * 4 + 1] = 0.f;

_m[2 * 4 + 2] = 1.f;

_m[2 * 4 + 3] = 0.f;

_m[3 * 4 + 0] = 0.f;

_m[3 * 4 + 1] = 0.f;

_m[3 * 4 + 2] = 0.f;

_m[3 * 4 + 3] = 1.f;

I got the wrong result, who knows how to correctly get the "skew" values? Perhaps another matrix is needed here?

Thanks, for help!


This topic has been closed for replies.