Jump to content
Alexli

3D transform of <image> element

Recommended Posts

Dear All,

 

I love Gsap and I am working on a website full of animations using Gsap. 

 

Gsap is awesome!

 

Recently I ran into a new problem, I am not able to do 3D transform for an <image> element in my SVG

 

I have looked into many threads in here, and this one too: 

See the Pen yzahJ by GreenSock (@GreenSock) on CodePen

 

I am not sure what I have missed, but I am quite sure Gsap can do the 3D transform of it.

 

Guys, please help me out. Thank you so much.

 

Wish you All have a wonderful Friday.

 

Cheers,

 

Alex

See the Pen jvdKoK by alexli2017 (@alexli2017) on CodePen

Share this post


Link to post
Share on other sites

Sorry, the current SVG spec doesn't allow 3D transforms on child elements. SVG 2.0 probably will. For now you can rotate the whole SVG all you want.

 

Hopefully that helps. Happy tweening.

:)

 

  • Like 5

Share this post


Link to post
Share on other sites

Dear Point C,

 

Thank you so much for your reply.

 

may I ask if there is something from gasp instead of can do this flipping besides 3D transform?

 

Thank you and wish you have a happy weekend.

 

cheers,

 

alex

Share this post


Link to post
Share on other sites

I'd recommend rotating the whole SVG or just using a regular DOM div/image instead of putting the image in the SVG. That being said, you can use scaleX:-1 which looks kind of like a y rotation. You could try this:

 

.to($('#hello'), 1, {scaleX:-1, transformOrigin:"center center", ease:Back.easeOut}, "helloGsapTLStart+=1");

 

That might work for your needs. Happy tweening.

:)

 

  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.