Share Posted March 23, 2016 Hi I'm trying to rotate an object around a central point. In this case the object is a pie. I want the pie to be spinning as it rotates! Any ideas? Many thanks! See the Pen LNyyYN by johnnyno (@johnnyno) on CodePen Link to comment Share on other sites More sharing options...
Share Posted March 23, 2016 The easiest way I can think of is to tween the rotation of the div with the transform origin where you have it, and at the same time tween the rotation of the img itself at its default transform origin. See the Pen KzmmzJ by sgorneau (@sgorneau) on CodePen 6 Link to comment Share on other sites More sharing options...
Author Share Posted March 23, 2016 Thanks Shaun, you're a star!!! 3 Link to comment Share on other sites More sharing options...
Share Posted March 23, 2016 Hi guys in addition ; you can use a bezier Tween too : See the Pen VabQZK by MAW (@MAW) on CodePen 3 Link to comment Share on other sites More sharing options...
Author Share Posted March 24, 2016 Thanks Diaco, because I now have this See the Pen GZmwML by johnnyno (@johnnyno) on CodePen The aborting pies are not following the exact same orbit... Could I use the bezier tween to create a consistent orbit for all the smaller pies? Thanks Link to comment Share on other sites More sharing options...
Share Posted March 24, 2016 yep , pls check this out : See the Pen jqmXYY by MAW (@MAW) on CodePen 4 Link to comment Share on other sites More sharing options...
Share Posted March 24, 2016 Awesome solution, Diaco! 1 Link to comment Share on other sites More sharing options...
Share Posted March 25, 2016 i think this can help you too , it's svg , but you can use that for div/img tag too ; now you can simply set the number of objects to orbit : See the Pen RaVzmz by MAW (@MAW) on CodePen 6 Link to comment Share on other sites More sharing options...
Share Posted March 27, 2016 awesome gears animation! 1 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