【cocos2dx】简单增加3D精灵

 std::string fileName = "orc.c3b";
    auto sprite = Sprite3D::create(fileName);
    sprite->setScale(3);
    sprite->setRotation3D(Vec3(0,180,0));
    sprite->setPosition( Vec2(100,100) );
    
    auto material = Sprite3DMaterial::createWithFilename("outline.material");
    material->setTechnique("outline_skinned");
    sprite->setMaterial(material);
    
    addChild(sprite);
   
    
    auto animation = Animation3D::create(fileName);
    if (animation)
    {
        auto animate = Animate3D::create(animation);
   
        animate->setSpeed(1);
        
        sprite->runAction(RepeatForever::create(animate));
    }


你可能感兴趣的:(cocos2dx)