Comments (10)
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.
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.
That's great. Can you share the code?
from matrix4_transform.
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;
from matrix4_transform.
Thanks!
from matrix4_transform.
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
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.
found Matrix4TransformTween just wrap Matrix4Tween
will try to check out pskink's code
thank you guys!
from matrix4_transform.
after checkout pskink's attached code, it animates like this :=)
from matrix4_transform.
jasonhe88
after checkout pskink's attached code, it animates like this :=)
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
after checkout pskink's attached code, it animates like this :=)
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)
- Skew support HOT 2
- 🎃 Hacktoberfest HOT 4
- Add an example with AnimatedContainer in ReadMe section. HOT 1
- Migrate to extensions? HOT 2
- Is there a Flutter Web support? (It shows yes)
- Child gets distorted.. HOT 4
- problem with from contractor HOT 2
- Support null safety HOT 1
- Perspective matrix transformation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matrix4_transform.