Reputation: 3996
I'm trying to make an iOS app with some 3D. My problem is the cocos3d hello world is fullscreen. So, I try to put the cocos3d into a window into a xib by following this tutorial for cocos2d, but it dont work for cocos3D (for me).
Anyone can help me to do something like that (small 3d view with UI). I'm a bit lost. I dont know where to search.
Thanks by advance.
Jordan
Upvotes: 1
Views: 167
Reputation: 2374
In the Cocos3D distribution, have a look at the CC3DemoMultiScene
demo app. It is an example of using Cocos3D within a larger view and controller using Storyboards. The AppDelegate
and MainViewController
are what you want to look at, as well as the Main-iPad
storyboard.
Specifically, the MainViewController
open3DControllerWithShadows:
and makeCC3ControllerWithShadows:
methods will point you in the right direction.
MainViewController
is more complex than you need, because it actually allows the user to completely shut down OpenGL ES, and swap out different scenes. You won't need that, and even if you do want to swap out scenes, do not use the technique here, because you certainly do not need to shut down OpenGL ES in between scene changes. It's included in this demo to prove that you can shut down OpenGL ES if you need to, not as an example of scene changing in general.
Upvotes: 3