Archive for 'opengl'

It is possible to get the rootviewcontroller of the project from within a class or scene in cocos2d using Xcode. This can be done using the nextResponder method of the OpenGLview of cocos2d director. It can be implemented as follows :

 

 

 

UIViewController *rootViewController = (UIViewController *)[[[CCDirector sharedDirector] openGLView] nextResponder];

 

In this, the rootViewController object will contain the original root view controller of the project.

Incoming search terms:

  • cocos2d 2 0 rootviewcontroller
  • cocos2d-x get rootviewcontroller
  • cocos2d-x view controller
  • cocos2d-x viewcontroller scene
  • xcode root view controller news

For getting the xib file from the resources, the following line of code is used :

[[NSBundle mainBundle] loadNibNamed:@”myXIBName” owner:self options:nil];

Now in order to get the main view of the XIB, use the following code :

UIView *myView = [[[NSBundle mainBundle] loadNibNamed:@”myXIBName”owner:self options:nil] objectAtIndex:0];

The above code will load the main view that is added in the xib file to the UIView object, myView.

We can add this UIView object to the Cocos2D scene as follows :

[[[CCDirector sharedDirector] openGLView] addSubview:myView];

Incoming search terms:

  • cocos2d x add uiview
  • cocos2dx objective-c uiview
  • how to create a new xib file and object in cocos2d tutorial

Here are the steps I have taken while following Bill’s article at http://brenwill.com/2011/cocos3d-importing-converting-collada-to-pod/

3D Globe Kit can be bought here
3D Globe eBook Can be bought here
3D Globe is a free app in iTunes

Get your 3D Max object ready
201102081232.jpg

Choose file export and choose Autodesk Collada export format.
201102081235.jpg

Read the rest of this entry

Incoming search terms:

  • xcode ar 3dobject
  • xcode 3d model in iphone
  • using 3max object in cocos2d
  • use 3dmax model in xcode
  • pod file converter 3d
  • ios 3dmax
  • how to put object on 3d globe in xcode
  • how to put image on 3d globe in xcode
  • for mac collada2pod download
  • download collada2pod for mac