Sprite3d not shown when using LayerColor

Sprite3d not shown when using LayerColor
0.0 0


Does any body Having this problem also ?
when using Sprite3d with simple 3d model on simple layer ( black colored )
the model shown as expected .

But when using LayerColor with Color the Sprite3d does not shown at all .
in the h the base is layerColor like this:

class HelloWorld : public cocos2d::LayerColor

this is the cpp with the LayerColor

#include "HelloWorldScene.h"
Scene* HelloWorld::createScene()
    // 'scene' is an autorelease object
    auto scene = Scene::create();
    // 'layer' is an autorelease object
    auto layer = HelloWorld::create();

    // add layer as a child to scene

    // return the scene
    return scene;

// on "init" you need to initialize your instance
bool HelloWorld::init()
    // 1. super init first
    if (!LayerColor::initWithColor(Color4B(0, 0, 255, 255)))
        return false;
    Size visibleSize = Director::getInstance()->getVisibleSize();
    Vec2 origin = Director::getInstance()->getVisibleOrigin();
    planRotationX = 90.0f;
    planRotationY = 0.0f;
    planRotationZ = 0.0f;

    cameraPosition3DX = 0.0f;
    cameraPosition3DY = 20.0f;
    cameraPosition3DZ = 25.0f;

    cameraRotation3DX = -60.0f;
    cameraRotation3DY = 0.0f;
    cameraRotation3DZ = 0.0f;
    //create a plane
    Sprite3D* _plane = Sprite3D::create("plain_yellow.c3b");
    _plane->setRotation3D(Vec3(planRotationX, planRotationY, planRotationZ));
    this->addChild(_plane, 10);

    //create Camera
    Camera* _camera = Camera::createPerspective(60, visibleSize.width / visibleSize.height, 0.1f, 200);
    _camera->setPosition3D(Vec3(cameraPosition3DX, cameraPosition3DY, cameraPosition3DZ));
    _camera->setRotation3D(Vec3(cameraRotation3DX, cameraRotation3DY, cameraRotation3DZ));
    this->addChild(_camera, 1);
    return true;
void HelloWorld::visit(cocos2d::Renderer *renderer, const cocos2d::Mat4 &parentTransform, uint32_t parentFlags)
    Layer::visit(renderer, parentTransform, parentFlags);
    _customCmd.func = CC_CALLBACK_0(HelloWorld::onDraw, this);
void HelloWorld::onDraw()



Hi Meir_yanovich,

I was just having a problem with LayerColor and 2d sprites. I was using LayerColor to produce a darkened background for my dialogue as well as capture touches and keystrokes. The dialogue consisted of a sprite with a few buttons on it.

It worked great on my phone and my tablet but when I used another phone the sprites and the buttons didn’t show up. They still worked but they weren’t visible. I thought it might be because of my Z coordinates so I started playing around with them but couldn’t get it to work on my third machine.

So I decided to change to a simple Layer and everything worked great. I don’t know why there would be a problem with LayerColor on one machine and not on others.