Share Posted November 20, 2018 Hi. I want the car to follow the track but also the whole of the rollercoaster to move to the left as the car is going along. And also for the car to slow climbing an incline and speed up on the descents. Very hard I know. Can anybody help? Thanks See the Pen JeMGzL by Gumbo (@Gumbo) on CodePen Link to comment Share on other sites More sharing options...
Share Posted November 20, 2018 You can study @OSUblake's demos from following thread on how to speed up and slow down based on path. You can set viewport based on current x translate of car to create camera like effect of following. You can get x position of car using car._gsTransform.x. But make sure the initial position of car is at 0, 0 in your SVG so you won't need to do additional calculations to get exact position of car. There is another advance demo by Blake, I don't think you need that but here is the link, 4 Link to comment Share on other sites More sharing options...
Share Posted November 20, 2018 Yeah, what Sahil already posted are the best examples of showing the complexity of what you want to achieve. It's no small task. I also thought of this example from Chris Gannon which is a bit simpler all around but necessarily easy. Just for inspiration See the Pen JGXVaR by chrisgannon (@chrisgannon) on CodePen 3 Link to comment Share on other sites More sharing options...
Author Share Posted November 21, 2018 Thanks everyone for your responses. I'll have a look into them all. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now