Jump to content
GreenSock

Moorthy G

How to rotate a square in diagonal axis using GSAP?

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

EDIT. My bad, I put the wrong info down

Link to comment
Share on other sites

  • Solution

Hi Moorthy G  :)

 

maybe there's a better solution, but for now with this way you can have a same effect : 

 

See the Pen bNYWbx by MAW (@MAW) on CodePen

  • Like 4
Link to comment
Share on other sites

Thanks Diaco, It worked for my purpose :)

 

Still, I'm curious to know how to achieve this by applying transformation to single element

Link to comment
Share on other sites

This is definitely an edge case, and probably the only one (at least that I know of) that isn't currently possible using normal transform components (rotationX, rotationY, rotation, etc.) but as Diaco.AW demonstrated, it's still possible to achieve the effect using an extra element. In order to accommodate an effect like this without using that extra element would mean injecting a fair amount of extra code for parsing/tweening Quaternions, but I just don't think the value proposition is worthwhile at this point. Perhaps if a lot of people start requesting this sort of thing, we can reconsider though. I think you're the 2nd person who has ever asked about this sort of thing :) (not that it's an invalid request at all - I'm just saying it's always a balancing act for us between file size, features, performance, API complexity, etc. and sometimes even good suggestions don't ultimately make sense to add in) 

  • Like 2
Link to comment
Share on other sites

  • 5 years later...

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.
×