How to save and retrieve Matrix4 object of flutter's Vector_math library?Saving an Object (Data persistence)How to save as a new file and keep working on the original one in Vim?How to define a two-dimensional array in PythonSql Server 'Saving changes is not permitted' error ► Prevent saving changes that require table re-creationMatrix mirror and scaleWhat is the difference between --save and --save-dev?Picture is 10x bigger in datastorage after manipulationCalculating Svg <g> tag widthFlutter : Bad state: Stream has already been listened toResetting a Stream to clear any Snapshot errors
Is it a problem that pull requests are approved without any comments
Whats the next step after commercial fusion reactors?
What risks are there when you clear your cookies instead of logging off?
How do I write "Show, Don't Tell" as an Asperger?
What happens if you do emergency landing on a US base in middle of the ocean?
How to make thick Asian sauces?
Are the AT-AT's from "Empire Strikes Back" a deliberate reference to Mecha?
How bad would a partial hash leak be, realistically?
Can a magnetic field of an object be stronger than its gravity?
Is the decompression of compressed and encrypted data without decryption also theoretically impossible?
Does the "6 seconds per round" rule apply to speaking/roleplaying during combat situations?
Avoiding cliches when writing gods
What are the words for people who cause trouble believing they know better?
My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?
How to generate random points without duplication?
Do any instruments not produce overtones?
What is in `tex.print` or `tex.sprint`?
Should I "tell" my exposition or give it through dialogue?
How do I calculate APR from monthly instalments?
You've spoiled/damaged the card
Accidentally renamed tar.gz file to a non tar.gz file, will my file be messed up
How to pass a regex when finding a directory path in bash?
What makes linear regression with polynomial features curvy?
Importance sampling estimation of power function
How to save and retrieve Matrix4 object of flutter's Vector_math library?
Saving an Object (Data persistence)How to save as a new file and keep working on the original one in Vim?How to define a two-dimensional array in PythonSql Server 'Saving changes is not permitted' error ► Prevent saving changes that require table re-creationMatrix mirror and scaleWhat is the difference between --save and --save-dev?Picture is 10x bigger in datastorage after manipulationCalculating Svg <g> tag widthFlutter : Bad state: Stream has already been listened toResetting a Stream to clear any Snapshot errors
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have ValueNotifier which is initialized with Matrix4. I can transform my view. Now I want to somehow save the current value of ValueNotifier in SQLite and again on loading initialize my ValueNotifier with saved Matrix4 value. Below is code:
ValueNotifier<Matrix4> notifier = ValueNotifier(Matrix4.identity());
MatrixGestureDetector(
onMatrixUpdate: (matrix, translationMatrix, scaleMatrix, rotationMatrix)
notifier.value = matrix;
,
child: AnimatedBuilder(animation: notifier,
builder: (context, child)
return Transform(
transform: notifier.value,
child: Container(
width: width,
height: height,
color: Colors.yellow,
),
);
),
)
matrix flutter save
add a comment |
I have ValueNotifier which is initialized with Matrix4. I can transform my view. Now I want to somehow save the current value of ValueNotifier in SQLite and again on loading initialize my ValueNotifier with saved Matrix4 value. Below is code:
ValueNotifier<Matrix4> notifier = ValueNotifier(Matrix4.identity());
MatrixGestureDetector(
onMatrixUpdate: (matrix, translationMatrix, scaleMatrix, rotationMatrix)
notifier.value = matrix;
,
child: AnimatedBuilder(animation: notifier,
builder: (context, child)
return Transform(
transform: notifier.value,
child: Container(
width: width,
height: height,
color: Colors.yellow,
),
);
),
)
matrix flutter save
add a comment |
I have ValueNotifier which is initialized with Matrix4. I can transform my view. Now I want to somehow save the current value of ValueNotifier in SQLite and again on loading initialize my ValueNotifier with saved Matrix4 value. Below is code:
ValueNotifier<Matrix4> notifier = ValueNotifier(Matrix4.identity());
MatrixGestureDetector(
onMatrixUpdate: (matrix, translationMatrix, scaleMatrix, rotationMatrix)
notifier.value = matrix;
,
child: AnimatedBuilder(animation: notifier,
builder: (context, child)
return Transform(
transform: notifier.value,
child: Container(
width: width,
height: height,
color: Colors.yellow,
),
);
),
)
matrix flutter save
I have ValueNotifier which is initialized with Matrix4. I can transform my view. Now I want to somehow save the current value of ValueNotifier in SQLite and again on loading initialize my ValueNotifier with saved Matrix4 value. Below is code:
ValueNotifier<Matrix4> notifier = ValueNotifier(Matrix4.identity());
MatrixGestureDetector(
onMatrixUpdate: (matrix, translationMatrix, scaleMatrix, rotationMatrix)
notifier.value = matrix;
,
child: AnimatedBuilder(animation: notifier,
builder: (context, child)
return Transform(
transform: notifier.value,
child: Container(
width: width,
height: height,
color: Colors.yellow,
),
);
),
)
matrix flutter save
matrix flutter save
edited Mar 24 at 22:53
mirkancal
6071518
6071518
asked Mar 24 at 14:08
Ankur PrakashAnkur Prakash
16010
16010
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Matrix4
has a getter storage
which returns an list of 16 doubles. It also has named constructors (.fromList
and .fromFloat64List
) as well as the normal constructor (which takes 16 individual doubles) which will construct a Matrix4
back from its component parts.
Depending on how you'd like to store the data in SQLite you could use a combination of these. If you wanted to store all 16 doubles as columns in the database, use storage[0], storage[1], ...
as your column values. You might also want to store it a character-separated string of 16 values. You could print append all 16 values with List.join(' ')
and parse them back out with String.split(' ')
.
The most efficient way (but least human readable) is probably to store it as a BLOB of 128 bytes. Use matrix.storage.buffer.asUint8List()
to convert matrix
to bytes, and use Matrix4.fromBuffer(bytes.buffer, 0)
to construct a matrix from a Uint8List
called bytes
.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324644%2fhow-to-save-and-retrieve-matrix4-object-of-flutters-vector-math-library%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Matrix4
has a getter storage
which returns an list of 16 doubles. It also has named constructors (.fromList
and .fromFloat64List
) as well as the normal constructor (which takes 16 individual doubles) which will construct a Matrix4
back from its component parts.
Depending on how you'd like to store the data in SQLite you could use a combination of these. If you wanted to store all 16 doubles as columns in the database, use storage[0], storage[1], ...
as your column values. You might also want to store it a character-separated string of 16 values. You could print append all 16 values with List.join(' ')
and parse them back out with String.split(' ')
.
The most efficient way (but least human readable) is probably to store it as a BLOB of 128 bytes. Use matrix.storage.buffer.asUint8List()
to convert matrix
to bytes, and use Matrix4.fromBuffer(bytes.buffer, 0)
to construct a matrix from a Uint8List
called bytes
.
add a comment |
Matrix4
has a getter storage
which returns an list of 16 doubles. It also has named constructors (.fromList
and .fromFloat64List
) as well as the normal constructor (which takes 16 individual doubles) which will construct a Matrix4
back from its component parts.
Depending on how you'd like to store the data in SQLite you could use a combination of these. If you wanted to store all 16 doubles as columns in the database, use storage[0], storage[1], ...
as your column values. You might also want to store it a character-separated string of 16 values. You could print append all 16 values with List.join(' ')
and parse them back out with String.split(' ')
.
The most efficient way (but least human readable) is probably to store it as a BLOB of 128 bytes. Use matrix.storage.buffer.asUint8List()
to convert matrix
to bytes, and use Matrix4.fromBuffer(bytes.buffer, 0)
to construct a matrix from a Uint8List
called bytes
.
add a comment |
Matrix4
has a getter storage
which returns an list of 16 doubles. It also has named constructors (.fromList
and .fromFloat64List
) as well as the normal constructor (which takes 16 individual doubles) which will construct a Matrix4
back from its component parts.
Depending on how you'd like to store the data in SQLite you could use a combination of these. If you wanted to store all 16 doubles as columns in the database, use storage[0], storage[1], ...
as your column values. You might also want to store it a character-separated string of 16 values. You could print append all 16 values with List.join(' ')
and parse them back out with String.split(' ')
.
The most efficient way (but least human readable) is probably to store it as a BLOB of 128 bytes. Use matrix.storage.buffer.asUint8List()
to convert matrix
to bytes, and use Matrix4.fromBuffer(bytes.buffer, 0)
to construct a matrix from a Uint8List
called bytes
.
Matrix4
has a getter storage
which returns an list of 16 doubles. It also has named constructors (.fromList
and .fromFloat64List
) as well as the normal constructor (which takes 16 individual doubles) which will construct a Matrix4
back from its component parts.
Depending on how you'd like to store the data in SQLite you could use a combination of these. If you wanted to store all 16 doubles as columns in the database, use storage[0], storage[1], ...
as your column values. You might also want to store it a character-separated string of 16 values. You could print append all 16 values with List.join(' ')
and parse them back out with String.split(' ')
.
The most efficient way (but least human readable) is probably to store it as a BLOB of 128 bytes. Use matrix.storage.buffer.asUint8List()
to convert matrix
to bytes, and use Matrix4.fromBuffer(bytes.buffer, 0)
to construct a matrix from a Uint8List
called bytes
.
answered Mar 24 at 15:03
Richard HeapRichard Heap
10k21424
10k21424
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324644%2fhow-to-save-and-retrieve-matrix4-object-of-flutters-vector-math-library%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown