Cocos2dx Camera problems while using Draw Primitives?

I’m running cocos2d-x v3.4 on OS X Yosemite 10.10.3, XCode 6.3. and am running into some issues using the camera. This is how i have set my game scene up…

I have GameScene which is a subclass of Scene which is the parent of MapNode, MapNode itself is a subclass of Node. MapNode mostly contains drawings of lines and shapes using the drawPrimitive
method. And it also contains few children such as Labels and Nodes.

This is how i have added the camera onto the MapNode

Camera* camera = Camera::createPerspective(60, (GLfloat)windowSize.width/windowSize.height, 1, 1000);
camera->setPosition3D(Vec3(screenCenter.x , screenCenter.y, startZoom));
this->addChild(camera); //add camera to mapNode

And also touch listeners to capture touch events and perform actions
on the camera such as move(3-D X, Y, and Z axis) and rotate3D. This works perfectly fine!!

Now i have a requirement to add a sprite or a label in the GameScene, which will act
as a sibling to MapNode.

Following is a code on GameScene

// Adding MapNode to GameScene
this->addChild(mapNode);

//Creating a sprite
auto mySprite = Sprite::create("treasure_chest.png", cocos2d::Rect(0,0,200,200));

this->addChild(mySprite);

RESULT No 1 : I don’t see mySprite anywhere on my GameScene. Tried tweaking the positions
and contentSize, still no hope.

Next, I attach a camera to the GameScene

auto s = Director::getInstance()->getWinSize();
auto sceneCamera = Camera::createPerspective(60, (GLfloat)s.width/s.height, 1, 1000);
    
sceneCamera->setPosition3D(Vec3(s.width/2, s.width/2, 1000));
    
this->addChild(sceneCamera); //add camera to the scene

RESULT No 2 : I see mySprite on the GameScene in the right place and size. I also see the MapNode with its children and drawPrimitives, but there are no visible actions performed on touch event.Touch recognition works absolutely fine as i’m logging it on my console. Also the move and rotate actions on the MapNode camera seems to working as i’m logging the position and rotation angle as well. But visually i do not see any change.

Next i read about CameraMask and CameraFlag, so on my next attempt i modified my code
on GameScene to

mapNode->setCameraMask((unsigned short)CameraFlag::USER1, true);

// Adding MapNode to GameScene
this->addChild(mapNode);


auto mySprite = Sprite::create("treasure_chest.png", cocos2d::Rect(0,0,200,200));

mySprite->setCameraMask((unsigned short)CameraFlag::USER1, true);
this->addChild(mySprite);

auto s = Director::getInstance()->getWinSize();
auto sceneCamera = Camera::createPerspective(60, (GLfloat)s.width/s.height, 1, 1000);

// Setting camera flag
sceneCamera->setCameraFlag(CameraFlag::USER1);
sceneCamera->setPosition3D(Vec3(s.width/2, s.width/2, 1000));

this->addChild(sceneCamera); //add camera to the scene

RESULT No 3 : I see same issue as RESULT No 2.

Next alteration i did was changed setCameraMask on MapNode not to apply masking on children

mapNode->setCameraMask((unsigned short)CameraFlag::USER1, false);

RESULT No 4 : I see everything mySprite, mapNode and its children(labels) and drawPrimitives. On performing touch event on MapNode I see all the children of MapNode responding to the event. All actions seems to work fine which means camera on MapNode is translating and rotating fine, but the drawPrimitives on MapNode is stationary. camera translation or rotating is not affecting the drawPrimitives in any ways.

Can you help me figure out what’s going wrong?