Created
August 8, 2011 16:08
-
-
Save dalmaer/1132051 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // create the "stage" (root container) | |
| stage = Sprite3D.createCenteredContainer(); | |
| // create the container that will be used to rotate its children, and add it to the stage | |
| container = new Sprite3D().setZ(-00).rotateX(-20).update(); | |
| stage.addChild( container ); | |
| // create front left face | |
| container.addChild( | |
| new Sprite3D() | |
| .setClassName("imageLeft") | |
| .setTransformOrigin( 0, 0 ) | |
| .setPosition( -100, -250, 100 ) | |
| .rotateY( -45 ) | |
| .setRotateFirst(true) | |
| .update() | |
| ); | |
| // rotate the container around the X and Y axis, then apply these transformations | |
| container | |
| .rotateY( -3 ) | |
| .setRotationX( Math.cos(t) * 15 - 20 ) | |
| .update(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment