Skip to content

Instantly share code, notes, and snippets.

@ricardoquesada
Created May 29, 2014 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardoquesada/50d9abe42456c7c178a3 to your computer and use it in GitHub Desktop.
Save ricardoquesada/50d9abe42456c7c178a3 to your computer and use it in GitHub Desktop.
High Level API for cocos2d-x's 3d animations
//
// API to play 3d animations on Sprite3D
//
// create the sprite
auto sprite3d = Sprite3D::create(“duck.ckb”);
sprite3d->setPosition3D(0, 0, 0);
this->addChild(sprite3d);
// get the animation
auto animation3d = Animation3D::getOrCreate(“duck.ckb”, “jump”);
// create the Animate action
auto animate3d = Animate3D::create(animation3d);
// run it
sprite3d->runAction(animate3d);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment