Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by Kasparas

  1. Hi,


    I'm spinning a three faced pyramid object using rotateY.  I've set up a TimelineMax consisting of three tweens with labels correspoding to points where each face of the pyramid is fully in front of the user. 


    When the pyramid is hovered on, I'd like to tween to the nearest label, such as to reveal the nearest "face" of the pyramid completely.


    On the codePen, I'm using the "currentLabel()" method which tweens the rotation to the "previous" label successfully. However, if a tween is past it's "midpoint", I'd like to tween to the next label, which is "closer" to the current position (it will take less rotation to reach it). 


    Maybe there is some already established / most elegant way to retrieve the "absolutely nearest label"  to current transform ? :) Hope this makes sense, thanks !







    See the Pen xLrqQe by Kasparas (@Kasparas) on CodePen