Skip to content

Instantly share code, notes, and snippets.

@christianb
Created June 2, 2019 21:41
Show Gist options
  • Save christianb/2bb5d28e7ff711bb6490c9cf089cb98c to your computer and use it in GitHub Desktop.
Save christianb/2bb5d28e7ff711bb6490c9cf089cb98c to your computer and use it in GitHub Desktop.
val matrix = Matrix()
val srcIndex = 0
val dstIndex = 0
val pointCount = 4 // or any other number of points you wanna transform
/**
* Set the matrix such that the specified src points would map to the specified dst points. The
* "points" are represented as an array of floats, order [x0, y0, x1, y1, ...], where each
* "point" is 2 float values.
*/
matrix.setPolyToPoly(srcFloatArray, srcIndex, dstFloatArray, dstIndex, pointCount)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment