Skip to content

Instantly share code, notes, and snippets.

@prideout
Created April 3, 2020 02:40
Show Gist options
  • Save prideout/43b6274468b9d7ce536a5d335e2e71db to your computer and use it in GitHub Desktop.
Save prideout/43b6274468b9d7ce536a5d335e2e71db to your computer and use it in GitHub Desktop.
getting-started-entities
// Reset the root transform, then rotate it around the Z axis.
modelViewer.asset?.apply {
modelViewer.transformToUnitCube()
val rootTransform = this.root.getTransform()
val degrees = 20f * seconds.toFloat()
val zAxis = Float3(0f, 0f, 1f)
this.root.setTransform(rootTransform * rotation(zAxis, degrees))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment