getTransformMatrix static method

Matrix4 getTransformMatrix(
  1. double value,
  2. Axis direction,
  3. double perspective
)

Implementation

static Matrix4 getTransformMatrix(
  double value,
  Axis direction,
  double perspective,
) {
  final Matrix4 mtx = Matrix4(
    1.0, 0.0, 0.0, 0.0, //
    0.0, 1.0, 0.0, 0.0, //
    0.0, 0.0, 1.0, 0.002 * perspective, //
    0.0, 0.0, 0.0, 1.0,
  );
  if (value != 0) {
    if (direction == Axis.vertical) {
      mtx.rotateX(value * pi);
    } else {
      mtx.rotateY(value * pi);
    }
  }
  return mtx;
}