Skip to content

Instantly share code, notes, and snippets.

@lucasdidthis
Created February 22, 2021 13:47
Show Gist options
  • Save lucasdidthis/55b87c827d36fd4ab0e31d1fd4037458 to your computer and use it in GitHub Desktop.
Save lucasdidthis/55b87c827d36fd4ab0e31d1fd4037458 to your computer and use it in GitHub Desktop.
Hovering-Animation for 3D Element
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