Open 4amVim opened 3 years ago
@4amVim Does this issue sound similar to your request ?
They both are about Canvas' internal matrix yes. But this issue proposes that we should include a bit on how to use vector_math to construct a matrix. Purely documentation, so that a developer can stumble upon good practices easier.
While that issue proposes that the internal matrix be exposed. Which is additional functionality.
Any documentation about the transform matrix?
Use case
Canvas.transform()
accepts a 4d matrix, but doesn't indicate any way to do it. Perusing only on documentation, only route forward is withFloat64List
.Creating matrices using
Float64List
is tedious, and it hampers code-readability. Yet, its the only way somebody just reading docs would construct a matrix fortransform
.Proposal
Given the extreme utility of
transform
, and its indispensability, in lots of use-cases, we should indicate a convenient way to use it. Currently, the (vector_math)[https://pub.dev/packages/vector_math] package offers a great way to createMatrix4
in a variety of ways, which can then be passed totransform
via.storage
. Moreover the package is maintained by Google.I'd be more than happy to submit a PR for the same.
TL;DR: Should add a mention of vector_math to the docstring of
Canvas.transform
, and add a simple example as well.