How to properly use vertexZ in isometric map?

Hi all,

How should I use vertexZ property properly? My sprite becomes invisible every time I assign a value to sprite’s vertexZ.

Here’s my code;

float lowestZ = -(tileMap->getMapSize().width + tileMap->getMapSize().height);
float currentZ = tilePos.x + tilePos.y;
this->setVertexZ(lowestZ + currentZ - 1.5f);

and here’s the screen captured (I set the cell opacity to less than 255 with onTouchesEnded to check on the sprite) ;

and when line this->setVertexZ(lowestZ + currentZ - 1.5f); is disabled, here’s my screen capture;

I have also overriden virtual draw function with

    glAlphaFunc(GL_GREATER, 0);
    glEnable (GL_ALPHA_TEST);

How should I fix this?

Thanks.

OK,
seems like the only workaround is to have the sprite embedded into the tmx files. Plus the vertexZ property can’t be changed from ‘outside’ of the parsed tmx file, as that would reset the lowest vertexZ to 0, making the sprite’s vertexZ to be rendered first then followed by (in my case above) the ground layer, as the sprite’s vertexZ is lower than the ground’s vertexZ.

Also seems like a lot of other topics were opened on the vertexZ issue in the forum;

http://discuss.cocos2d-x.org/t/vertexz-3/12037/4
https://github.com/cocos2d/cocos2d-x/issues/8372
http://discuss.cocos2d-x.org/t/vertexz-problem/9677
http://discuss.cocos2d-x.org/t/vertexz-question/5275
http://discuss.cocos2d-x.org/t/tile-map-sprite-rendering-is-broken-in-version-3-at-least-3-2/15757/6
https://github.com/cocos2d/cocos2d-x/issues/8524

Any update on the status of the above problem?

Thanks.