horde3d-x icon indicating copy to clipboard operation
horde3d-x copied to clipboard

What is the version of horde2d and cocos2d-x that your fork based on.

Open yihuang opened this issue 11 years ago • 4 comments

I want to migrate it to cocos2d-x 2.x .

yihuang avatar Nov 07 '13 11:11 yihuang

cocos2d-x 2.1 horde3d is branched from svn sourceforge half year ago.

attilaz avatar Nov 08 '13 08:11 attilaz

I'm not familiar with 3d programming, but i want to display some 3d objects in my cocos2d-x game, i try to display a cocos2d-x CCSprite and horde3d KnightX Scene, but the cocos2d-x part doesn't display at all. Commenting out the ClearTarget part in pipeline xml don't help too. What steps should i take to make it work together, or is it possible at all? Thanks very much.

yihuang avatar Dec 12 '13 11:12 yihuang

It's so nice if i can use horde3d to add some 3d objects to my existing cocos2d-x game, and this feature can definitely improve horde3d's acceptance. I can put some time into this, but I need to be enlightened.

yihuang avatar Dec 13 '13 03:12 yihuang

I think it is caused because h3d modifies some state, you should reset states before rendering with cocos2d-x. here is what I'm doing for state reset:

glViewport(0,0,width, height);

glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
glDisable(GL_BLEND);

glLineWidth(1.0);

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glActiveTexture(GL_TEXTURE0);

for( unsigned int i = 0; i < ATTRIB_COUNT; ++i )
    glDisableVertexAttribArray( i );

hope it helps. Also I don't want to discourage you using h3d, but cocos2d-x will also have an official 3d extension. If you are planning in the long term, maybe it is a better solution.

attilaz avatar Dec 13 '13 09:12 attilaz