Jump to content
Search Community

Improve an animation of butterflies flying

Rebeca test
Moderator Tag

Recommended Posts

Hi there! I tried to simulate butterflies that float or fly, but I think the effect could be improved ... I see it very unnatural ... can someone give me a tip to improve it? I'm also not sure if the code I used is the most correct (just a week ago I started with gsap).
It had occurred to me that butterflies fly in more sinuous ways, but I don't know how to approach it, if someone has an idea I would appreciate it! Thanks a lot

See the Pen Bapmrpz by rebecakarenok (@rebecakarenok) on CodePen

Link to comment
Share on other sites

I like to animate each property separately, so they run at different speeds and change at different times. Using a sine ease also seems to look more natural.

 

gsap.to("#mariposa-1", {
  ...
  x: "random(-180, 180)",
  ease: "sine.inOut"
});

gsap.to("#mariposa-1", {
  ...
  y: "random(-180, 180)",
  ease: "sine.inOut"
});

gsap.to("#mariposa-1", {
  ...
  scale: "random(0.6, 1)",
  ease: "sine.inOut"
});

gsap.to("#mariposa-1", {
  ...
  rotation: "random(-180, 180)",
  ease: "sine.inOut"
});

 

  • Like 4
Link to comment
Share on other sites

13 hours ago, Rebeca said:

Hi there! I tried to simulate butterflies that float or fly, but I think the effect could be improved ... I see it very unnatural ... can someone give me a tip to improve it? I'm also not sure if the code I used is the most correct (just a week ago I started with gsap).
It had occurred to me that butterflies fly in more sinuous ways, but I don't know how to approach it, if someone has an idea I would appreciate it! Thanks a lot

I have changed the original version. Made with svg MotionPathPlugin, where butterflies travel invisible lines to simulate flight

Link to comment
Share on other sites

12 hours ago, OSUblake said:

I like to animate each property separately, so they run at different speeds and change at different times. Using a sine ease also seems to look more natural.

 


gsap.to("#mariposa-1", {
  ...
  x: "random(-180, 180)",
  ease: "sine.inOut"
});

gsap.to("#mariposa-1", {
  ...
  y: "random(-180, 180)",
  ease: "sine.inOut"
});

gsap.to("#mariposa-1", {
  ...
  scale: "random(0.6, 1)",
  ease: "sine.inOut"
});

gsap.to("#mariposa-1", {
  ...
  rotation: "random(-180, 180)",
  ease: "sine.inOut"
});

 

Thanks, I've tried it and it looks better! Now try invisible curved lines in the svg and traversing them with MotionPathPlugin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...