Jump to content
Search Community

Objects should end up falling off a conveyor belt with different resolutions

BFreakout test
Moderator Tag

Recommended Posts

Hello community,
I have a treadmill (conveyor belt) in SVG. Elements should roll off the conveyor to this end and then fall off. I have already mastered this animation with fixed values. My problem is that it also has to work with different resolutions. Otherwise the objects float in the air and fall. Now I tried to recognize the width of the treadmill (offsetWidth) and to make the animation of this length. But the treadmill (SVG) is wider than the visible area.

 

Here are some pictures:

 

image.png.54fdbee30e86f1bb77e5fe5d2b3c5781.png

 

image.png.8baa6e675fe61ff01635cc604ba29087.png

 

I would be very grateful for your help!
 

P.S. If someone had an additional tip for falling physics with greensock, I would be grateful for it :) So far, they only fall straight down ..


 

Link to comment
Share on other sites

Hey BFreakout and welcome! 

 

There are several methods that you can use to do this. The first that came to my mind is to use MotionPathPlugin, especially if your conveyor belt and items are all SVG (but they don't have to be - it just makes resizing easier). Motion paths made with it aren't responsive by default, but you can kill and old instance and re-create it when you need to. 

 

17 minutes ago, BFreakout said:

If someone had an additional tip for falling physics with greensock, I would be grateful for it :) So far, they only fall straight down ..

I recommend fake physics rather than trying to use real physics. By that I mean use a motion path that doesn't go straight down and you could use a separate tween (applied to a container <g> most likely) that adds some rotation if you want to as well.

 

If you really and to do something with physics, you could look into this library: https://github.com/subprotocol/verlet-js

  • Like 2
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...