Hi, folks, i have a question about CCGrid3D in cocos2d-x 2.2.6, I’m new to all these things, so if I ask something obvious - sorry.
I have a road png file - looks like here.
https://dl.dropboxusercontent.com/u/7308748/!tmp/road.png
And I want to curve it, make some hills. I found CCGrid class, read the description, and thought, that it may help me.
I do following things:
CCSprite *roadbed = CCSprite::create("road.png");
this->addChild(roadbed);
Then I’m trying to create grid and apply it to my sprite:
CCGrid3D *grid = CCGrid3D::create(CCSize(6, 2), roadbed->getTexture(), false);
ccVertex3F vertex = grid->vertex({2, 1});
grid->setVertex({120, 50}, vertex);
roadbed->setGrid(grid);
roadbed->getGrid()->setActive(true);
I made size with CCSize(6, 2) form the scratch, and also selected random point {120, 50} to curve in.
After these things I see nothing, and if I dont set my grid to active, i see original smooth sprite (as abvious).
Maybe I do it wrong or use wrong stuff? Any help or advice would be great.
Thanks!