Created
February 22, 2021 13:47
-
-
Save lucasdidthis/55b87c827d36fd4ab0e31d1fd4037458 to your computer and use it in GitHub Desktop.
Hovering-Animation for 3D Element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
element.rotation.z = -0.2 - (1 + Math.sin(elapsedTime / 1.5)) / 20; | |
element.rotation.x = Math.cos(elapsedTime / 4) / 8; | |
element.rotation.y = Math.sin(elapsedTime / 4) / 8; | |
element.position.y = (1 + Math.sin(elapsedTime / 1.5)) / 10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment