So I was able to import 3d scene generated from Cocosstudio into my C++ project. However, when I try to add new Sprite3D object dynamically to the scene, it doesn’t work. It appears that the new object is added to the 2D layer of the scene class and not the 3D scene itself.
Have anyone able to do this?
Thanks in advance
Charles Dang
---- Sample code ----
Node node3d = CSLoader::createNode(“BattleScene3D.csb”); //contain 6 objects locate around the origin(0,0,0)
this->addChild(node3d);
…
Sprite3D teapot = Sprite3D::create(“3d/teapot.c3b”);
teapot->setTexture(“3d/teapot.png”);
teapot->setScale(6);
teapot->setPosition3D(Vec3(0,0,0)); //set at origin of the 3d scene, center of 6 existing objects
node3d->addChild(teapot);
—>When run, I only see the 6 objects created in Cococostudio, but not the teapot.