Code Monkey home page Code Monkey logo

Comments (10)

marcglasberg avatar marcglasberg commented on June 28, 2024

Yes, it is possible, and I know how to do it. But I'm not sure people actually need this. Myself, I usually use Matrix4Transform with https://pub.dev/packages/align_positioned , which solves most of this weird transformation problems. So in the end I'm not sure there is demand for that, and it's some work to implement this, so I didn't.

If this package ever reaches 90 I will invest the time to add some more interesting stuff.

from matrix4_transform.

pskink avatar pskink commented on June 28, 2024

thanks for your info, actually today i wrote similar class to your Matrix4Transform and Tween for it which animates in a normal, expected way

from matrix4_transform.

marcglasberg avatar marcglasberg commented on June 28, 2024

That's great. Can you share the code?

from matrix4_transform.

pskink avatar pskink commented on June 28, 2024

sure, its 8 hours work so it still needs some extra code (assert()s most likely for discovering potential problems) - i had to rename source file to .txt since i was not able to upload .dart file, also i tested it in flutter desktop environment - if it does not work on real device / emulator remove the first line from main function: debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;

matrix_builder.txt

from matrix4_transform.

marcglasberg avatar marcglasberg commented on June 28, 2024

Thanks!

from matrix4_transform.

jasonhe88 avatar jasonhe88 commented on June 28, 2024

tried to use Matrix4TransformTween to rotate a Container around its center, found it has same behavior as Matrix4Tween.

recorded the animation as a GIF here

Oct-19-2021 21-47-36

Matrix4Transform begin =
    Matrix4Transform().rotate(0, origin: Offset(75, 75));
Matrix4Transform end =
    Matrix4Transform().rotate(3.1415926535 / 2, origin: Offset(75, 75));
mt = Matrix4TransformTween(begin: begin, end: end).animate(controller);

...........................

 Container(
        alignment: Alignment.center,
        width: 150,
        height: 150,
        color: Colors.blue.withOpacity(0.3),
        child: Container(
            width: 150,
            height: 150,
            transform: mt.value.matrix4,
            color: Colors.red.withOpacity(0.3))))

from matrix4_transform.

jasonhe88 avatar jasonhe88 commented on June 28, 2024

found Matrix4TransformTween just wrap Matrix4Tween

will try to check out pskink's code

thank you guys!

from matrix4_transform.

jasonhe88 avatar jasonhe88 commented on June 28, 2024

after checkout pskink's attached code, it animates like this :=)

Oct-19-2021 23-05-56-2

from matrix4_transform.

pskink avatar pskink commented on June 28, 2024

jasonhe88

after checkout pskink's attached code, it animates like this :=)

Oct-19-2021 23-05-56-2

use
var begin = MatrixBuilder(
rotationOrigin: Offset(75, 75),
);

and pass it to:
var tween = MatrixBuilderTween(
begin: begin,
end: end,
);

in your code rotationOrigin is most likely not set (or set to Offset.zero)

from matrix4_transform.

jasonhe88 avatar jasonhe88 commented on June 28, 2024

jasonhe88

after checkout pskink's attached code, it animates like this :=)
Oct-19-2021 23-05-56-2

use var begin = MatrixBuilder( rotationOrigin: Offset(75, 75), );

and pass it to: var tween = MatrixBuilderTween( begin: begin, end: end, );

in your code rotationOrigin is most likely not set (or set to Offset.zero)

Yes!!!, after set begin's rotationOrigin, it works as expected.

save my day! thank you.

from matrix4_transform.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.