ramonbjj Posted February 25 Posted February 25 Hi everyone, I’m trying to create a 3D animation with GSAP where a square rotates like a disk, respecting the perspective. The square is tilted with rotationX and rotationY, but I want it to rotate around its own Z-axis in 3D, like spinning on its edges. The rotation currently feels flat and clockwise, and I want it to rotate in the direction of the square itself, taking the 3D perspective into account. Any tips on how to achieve this? Thanks in advance! Codepen: See the Pen pvoEKaX by ramonv (@ramonv) on CodePen.
Solution Rodrigo Posted February 25 Solution Posted February 25 Hi @ramonbjj and welcome to the GSAP Forums! The simplest and easiest way is to wrap the element with another, tilt that parent element and rotate the one inside. Something like this: See the Pen gbOwdRM by GreenSock (@GreenSock) on CodePen. Hopefully this helps Happy Tweening!
ramonbjj Posted February 25 Author Posted February 25 38 minutes ago, Rodrigo said: Hi @ramonbjj and welcome to the GSAP Forums! The simplest and easiest way is to wrap the element with another, tilt that parent element and rotate the one inside. Something like this: Hopefully this helps Happy Tweening! Nailed it, thank you! I've updated my code using your solution, that's exactly what I needed. See the Pen pvoEKaX by ramonv (@ramonv) on CodePen.
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