I use CCOrbitCamera to flip sprite. and I have one problem..

I use CCOrbitCamera to flip sprite which is on the other big sprite.

When run the flip action, half of the sprite is hided behind of the big sprite. and after flip 180 degree then show all of it.

I want to show all of the sprite during turning…

Can anyone give me some advice?

Thanks in advance. :slight_smile:

I add layer under sprite in test example.
It shows my problem.

Oops error occurred during uploading image…
See here please.
http://dl.dropbox.com/u/6521649/www.png

I have meet the same issue. And it is produce 100% in the cocos2dx-0.13 and cocos2dx-gles2.
Just in the HelloWorldscene I added a ColorLayer (Or tile map )on the Helloworldscene and use the CCOrbitCamera and run action, then the sprite only show half of them.

CCLayerColor* m_pLayer = CCLayerColor::layerWithColor(ccc4(128, 128, 128, 128));
addChild(m_pLayer, ~~1);

CCSprite* sp = CCSprite::spriteWithFile;
sp~~>setPosition(ccp(sp~~>boundingBox.size.width,sp~~>boundingBox().size.height/2));
this~~>addChild;
CCActionInterval* orbit3 = CCOrbitCamera::actionWithDuration;
CCFiniteTimeAction* action3 = CCSequence::actions;
sp~~>runAction(action3);

That’s because of the Z coordinate of the sprite.
Half of the sprite has negative Z value during rotation.

Why we add a CCLayerColor or tile map will change the half sprite Z coordinate?
Do we have some method to avoid this?

Say, the Z position of tilemap is Zero. When you rotate a sprite, Z-position of half of the sprite is less than Zero and the other one is larger than Zero.
So half of them can be displayed while another half cannot.

You may disable depth test (in CCDirector) to display the sprite regardless of the Z-value.
It is just a workaround and result may not fulfill your requirement.