调试捕鱼人的3d的小例子的时候,3d模型死活不显示
不对的对比各种原因,最后发现时3d模型的全局zorder的问题,一定要设置3d模型的zorder大于2d layer的zorder才行
bool FishLayer::init() { //this->setGlobalZOrder(-1); //加载模型文件 std::string fileName = "tortoise.c3b"; m_Sprite = Sprite3D::create(fileName); m_Sprite->setScale(0.1f); auto s = Director::getInstance()->getWinSize(); m_Sprite->setPosition(Vec2(s.width / 2.f,s.height / 2.f)); m_Sprite->setGlobalZOrder(100); //加上这一句------------------------------------------------------------------------------ addChild(m_Sprite);