Vote count:
0
I assembled an app based on some of the example cocos3d code, and everything seems to work fine, except when I remove a node loaded from a POD file, and load it again. In this case the model appears as all black as though no textures were loaded.
A basic flow allows the user to select a model from a list, and manipulate it (move, scale, etc.). They can remove the model and select another one. Selecting a different model works fine, but selecting one that was previously loaded appears as all black.
Code looks something like (summarized)...
CC3PODResourceNode* rezNode = [CC3PODResourceNode nodeFromFile:[url path]];
[modelNode addChild:rezNode];
// manipulate
[modelNode removeChild:rezNode];
The first time for a specific model this looks fine. As mentioned, loading the same model after removing it results in a black (non-textured) node. Nothing else changes in the world between (i.e. light, camera and other models stay the same). The debug log shows the textures being removed with the node, and then added again when the model is loaded.
Aucun commentaire:
Enregistrer un commentaire