Skip to content

Instantly share code, notes, and snippets.

@dalmaer
Created August 8, 2011 16:08
Show Gist options
  • Select an option

  • Save dalmaer/1132051 to your computer and use it in GitHub Desktop.

Select an option

Save dalmaer/1132051 to your computer and use it in GitHub Desktop.
// 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