ios - studio - ¿Es posible utilizar scenekit en el proyecto cocos2d para representar objetos en 3D?
cocos2d descargar (0)
-(id) init {
self = [super init];
CGSize wSize = [[CCDirector sharedDirector] viewSize];
CCSprite*imgBackground = [CCSprite spriteWithImageNamed:@"imgBackground.png"];
imgBackground.anchorPoint = ccp(0, 0);
[self addChild:imgBackground];
//adding the plus button
btnPlus = [CCButton buttonWithTitle:@"[ Plus ]" fontName:@"Georgia" fontSize:16.0f];
btnPlus.positionType = CCPositionTypeNormalized;
btnPlus.position = ccp(0.25f, 0.25f);
[btnPlus setTarget:self selector:@selector(btnPlusClicked)];
[self addChild:btnPlus];
btnMinus = [CCButton buttonWithTitle:@"[ Minus ]" fontName:@"Georgia" fontSize:16.0f];
btnMinus.positionType = CCPositionTypeNormalized;
btnMinus.position = ccp(0.75f, 0.25f);
[btnMinus setTarget:self selector:@selector(btnMinusClicked)];
[self addChild:btnMinus];
//view.scene = (SCNScene*)self.scene;
UIView *overlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 560)];
SCNBox* boxGeometry = [SCNBox boxWithWidth:10.0 height:10.0 length:10.0 chamferRadius:1.0];
dScene = [[SCNScene alloc] init];
node = [SCNNode nodeWithGeometry:boxGeometry];
//view = [[SCNView alloc] init];
//view.scene = dScene;
//overlay.backgroundColor = [UIColor colorWithWhite:1 alpha:.5];
//view = [[SCNView alloc] init];
//view.backgroundColor =[UIColor colorWithWhite:0 alpha:.5];
//[overlay addSubview:view];
[[[CCDirector sharedDirector] view] addSubview:overlay];
[dScene.rootNode addChildNode:node];
//[self.scene addChild:node];
//node.light = SCNLightTypeAmbient;
return self;
}
Intento agregar un objeto 3d usando scenekit a un proyecto cocos2d porque scenekit parece prometedor.
Sin embargo, recibo un error
OpenGL error GL_INVALID_FRAMEBUFFER_OPERATION detected at CCRenderStateGLTransition 298
OpenGL error GL_INVALID_FRAMEBUFFER_OPERATION detected at CCRenderStateGLTransition 298
OpenGL error GL_INVALID_FRAMEBUFFER_OPERATION detected at CCRenderStateGLTransition 298
Alguien sabe si es posible hacerlo? Cualquier consejo sería agradecido. ¡Gracias!