
A screenshot from the cocos3d Application template, showing a 3D take on the traditional 'hello, world' app.
Update [2011-12-19]:
cocos3d 0.6.5 has been released.
This is an important patch release that fixes an error in the soft-body vertex skinning POD loading mechanism that was introduced in cocos3d 0.6.3. This issue affected some large and complex POD files, and caused some regular mesh nodes to be loaded as skinned nodes, which resulted in them sometimes not being rendered.
This issue affects all POD files, including those that do not contain soft-body nodes or use vertex skinning.
If you are using cocos3d 0.6.3 or cocos3d 0.6.4, it is strongly recommended that you upgrade to the 0.6.5 version.
Find out what’s new here.
cocos3d ia a significant extension to cocos2d that adds a full 3D modelling space, including 3D mesh models, perspective projection cameras, materials, and lighting. With cocos3d, you can populate your world with 3D models exported from 3D editors such as Blender, 3ds Max or Cheetah3D, combined with models you create dynamically in your Objective-C code.
Integration with cocos2d is seamless. Rendering of all 3D model objects occurs within a special cocos2d layer, which fits seamlessly into the cocos2d node hierarchy, allowing 2D nodes such as controls, labels, and health bars to be drawn under, over, or beside 3D model objects. With this design, 2D objects, 3D objects, and sound can interact with each other to create a rich, synchronized audio-visual experience.
Like cocos2d, cocos3d is written entirely in Objective-C, and many of your favourite cocos2d paradigms, such as CCActions, are available for 3D objects. And like cocos2d, it is distributed for free under an MIT license.
cocos3d Features
Some of the key features of cocos3d are highlighted in the following list:
- Seamless integration with cocos2d. Rendering of all 3D model objects occurs within a special cocos2d layer, which fits seamlessly into the cocos2d node hierarchy, allowing 2D nodes such as controls, labels, and health bars to be drawn under, over, or beside 3D model objects. With this design, 2D objects, 3D objects, and sound can interact with each other to create a rich, synchronized audio-visual experience.
- Pluggable loading framework for 3D models exported from familiar 3D editors such as Blender, 3ds Max or Cheetah3D, or through industry standard 3D object files such as Collada or PowerVR POD, or even from your own customized object file formats.
- 3D models can be selected and positioned by touch events, allowing intuitive user interaction with the objects in the 3D world.
- 3D models can include animation sequences, with full or fractional animation.
- 3D model objects can be arranged in sophisticated structural assemblies, allowing child objects to be moved and oriented relative to their parent structure.
- 3D models and assemblies can be easily duplicated. Each duplicated model can be independently controlled, animated, colored, or textured. But fear not, underlying mesh data is shared between models. You can quickly and easily create swarming hoards to populate your 3D world, without worrying about device memory limitations.
- 3D models, cameras, and lighting can be manipulated and animated using familiar cocos2d Actions, allowing you to quickly and easily control the dynamics of your 3D world, in a familiar, and easy-to-use programming paradigm.
- 3D objects can be covered with dynamic materials and textures to create rich, realistic imagery.
- Multi-texturing and bump-mapped textures are available, allowing you to create sophisticated surface effects.
- Vertex skinning, also often referred to as bone rigging, allowing soft-body meshes to be realistically deformed based on the movement of an underlying skeleton constructed of bones and joints.
- The 3D camera supports both perspective and orthographic projection options.
- Objects can dynamically track other objects as they move around the world. The 3D camera can dynamically point towards an object as it moves, and other objects can dynamically point towards the camera as it moves.
- Lighting effects include multiple lights, attenuation with distance, spotlights, and fog effects.
- Mesh data can be shared between 3D objects, thereby saving precious device memory.
- Mesh data can freely, and automatically, use OpenGL vertex buffer objects to improve performance and memory management.
- Culling of 3D objects outside of the camera frustum is automatic, based on pluggable, customizable object bounding volumes.
- Automatic ordering and grouping of 3D objects minimizes OpenGL state changes and improves rendering performance. Pluggable sorters allow easy customization of object sorting, ordering, and grouping for optimal application performance.
- 3D point particles allow sophisticated particle effects.
- Automatic OpenGL state machine shadowing means that the OpenGL functions are invoked only when a state really has changed, thereby reducing OpenGL engine calls, and increasing OpenGL throughput.
- Sophisticated performance metrics API and tools collect real-time application drawing and updating performance statistics, for logging or real-time display.
- Sophisticated math library eliminates the need to use OpenGL ES function calls for matrix mathematics.
- Fully documented API written entirely in familiar Objective-C. No need to switch to C or C++ to work with 3D artifacts.
- Extensive logging framework to trace program execution, including all OpenGL ES function calls.
- Includes demo applications and Xcode templates to get you up and running quickly.
A Picture is Worth a Thousand Words
The following two screenshots are taken from the CC3DemoMashUp sample demo application that is included in the cocos3d distribution, and highlight some of the cocos3d functionality. The pictures show a scene taken at two different times.

The lighting is now dimmer, the robot arm has moved, and the 2D label is larger as it approaches the camera.
The scene includes:
- An animated rotating robot arm loaded from a PowerVR POD file. This POD file is taken from a sample demo that is bundled with the standard PVR SDK from Imagination Technologies. It demonstrates the ability to load and animate ‘out-of-the-box’ POD files. It also demonstrates how 3D nodes are assembled into a structural hierarchy (similar to cocos2d nodes), in that the arm has several parts that move relative to each other, while the complete robot assembly can be moved, rotated or scaled as a whole.
- A standard cocos2d text label that is attached to the end of the robot arm and rotates with the arm. This demonstrates the ability for 2D and 3D nodes to interact. This label could have been any cocos2D
CCNode, even one you create yourself. - Four Utah teapots built from the
teapot.hheader file distributed with the iOS SDK. The red, green and blue teapots are positioned at 100.0 on the X, Y and Z axes, respectively. The white teapot is positioned at the location of the light source for the scene, which is also animated as part of the POD file. The teapots demonstrate how cocos3d model objects can be created programmatically instead of loaded from 3D files. To conserve memory, the teapots all use the same underlying copy of mesh data, but each has a different material so they can be colored separately. - A cocos2d logo positioned and scaled to act as a ‘floor’ or ‘ground’ to give the scene some spatial orientation. This logo is part of the 3D scene.
- Two green joystick buttons to control the panning and location of the 3D camera (the viewer’s perspective), and an arrow button to cycle the camera through three other scenes (by rotating the camera to the left). All three buttons are standard cocos2d nodes, and are added as children to the special
CCLayerthat is playing the 3D scene, demonstrating how 2D nodes can be overlayed on the 3D view. BTW…they joysticks are part of a small UI controls kit we created. You can find the kit here.
In the view on the left, the robot arm is rotating towards the back, with the 2D cocos2d label attached to the end. In the view on the right, the robot arm has rotated towards the front. The 2D label has come with it, and is scaled up automatically to create the proper perspective. This perspective scaling of 2D artifacts is optional. For something like a 2D health-bar hovering over a 3D character, you might want to keep it the same size, regardless of where the character is roaming.
Also in the second picture, the location of the light source (as marked by the white teapot), has moved down (think of a setting sun), and as a result, the lighting has dimmed, particularly on the side of objects facing away from the light.
In addition to the scene illustrated, the CC3DemoMashUp includes three other scenes, which can be viewed either by panning the camera, or by pushing the arrow button. These scenes are:
- A bouncing, multi-colored, semi-transparent beach-ball, which bounces courtesy of standard cocos2d
CCActions. The beach-ball demonstrates a multi-material mesh model and transparency blending. It is particularly effective if you use the joysticks to move the camera behind the beach-ball and point the camera back towards the robot arm. You can see the robot arm through the beach-ball as it bounces by. - Another two teapots, one textured and one with a color gradient applied to its vertices, rotating around each other.
- A rotating globe that demonstrates the ability to wrap a mesh with a UV mapped texture exported from a 3D editor.
The bouncing beach-ball and rotating globe were constructed in Blender, exported to a Collada 1.4 file format, and then converted to POD file format using the Collada2POD converter that comes with the PowerVR SDK. The ‘change view’ arrow button demonstrates the ability to assign a target location to cameras and lights. The button assigns a different target to the camera, and the camera pans (again using a cocos2d CCAction) to its new target.
More Info
You can download cocos3d here.
You can learn more about writing 3D iOS applications using cocos3d, by referring to:
- cocos3d homepage.
- cocos3d Programming Guide.
- cocos3d API.
- Demo applications in the
Demosfolder in your cocos3d distribution. - cocos3d Development Roadmap.
- cocos3d Forum
- cocos3d Importing: Converting COLLADA to POD
- Check out a example video of a robot game created by cocos3d user andyman404 in less than a week!





Lucky for me, this is great timing. I’ve been creating our art assets for ‘VectorBloom the Game’ game using Maya 3D to create 2D snapshot png files we use within Cocos2D. Can I export a mesh created in Maya as an FBX object? Will my shaders import too? Or do I have to download the Collada plug-in to use my Maya objects with the Cocos3D library? Thanks again for the library, awesome work!
@Elizabeth
Unfortunately, with this initial release, cocos3d supports importing via the POD file format only. We plan to add other file formats as we move forward.
The PowerVR SDK (link in article above) does include an exporter from Maya to POD files, but not for Mac. If you’re using Mac, It looks like your best bet might be to export your meshes from Maya to Collada, and then use the Collada2POD converter in the PowerVR SDK.
I’ll be posting an article on the Brenwill site in the next few days, with instructions on configuring the Collada2POD tool for exporting to cocos3d. Keep an eye out for it.
Regarding shaders…no. cocos3d, like cocos2d, uses OpenGLES 1.1, so it doesn’t currently support shaders. Unfortunately, you’ll have to export as meshes, materials and textures for the time being.
Thanks…
…Bill
This sounds really great. I put some of my games in development on hold due to the limitations in cocos2d wrt. 3D.
Are particle effects also supported in 3D now? CCParticleSun for example.
Wow this is awesome news. Any plans of integrating a 3D physics engine as well?
Which version iOS SDK is required for work?
Cinema 4D support please!
That looks pretty amazing! V nice. I still think that 3d adds a huge amount of work to a project, so I wont be diving-in quite yet, but that is a brilliant addition to the library.
I wonder if using OBJ-C entirely is really an advantage because from what I have heard that the function lookup by string that obj-c uses has a notable performance penalty and I guess that there are functions that are called quite often.
Installed the template. Compilation stops at the PVR stuff. Jez. Thought this was tested before. Anyway. Thnaks for sharing
Looking forward to testing this out.
Looking forward to some Mac tools for creating the POD files & that tutorial!
Unity’s strength is that links up with Cinema4D – this is basically the de-facto tool for anyone doing 3D on the Mac. Cinema4D can export quite faithfully to Collada these days.
Blender is free but a total nightmare to use, so people stay well away from it.
Installed and ran the demo project. Also, tried the template and ran Hello World. No problems so far. Using cocos2d-0.99.5 together with it.
@Festival
Sorry you’re having trouble.
Can you see if this post in the cocos3d forum helps you, please?
The compiler directive BUILD_OGLES being missing in the Release build config. It is included in the Debug build config.
If this is indeed your issue, you can simply add the BUILD_OGLES compiler directive as explained in that discussion, or switch to the Debug config for the time being.
We will be fixing this issue in the next patch, of course.
Thanks…
…Bill
Thank you for this! I will be taking a look at this very soon!
This place rocks!
@mjrehder & @asadr – Particles and physics are planned. See the cocos3d Development Roadmap for more info.
@marco2D & @hawken – thanks for identifying Cinema4D as an important import source.
@allXumuk – if you mean which iOS will it run on, it should run on all, including iPod, iPhone & iPad. If you mean which SDK should you use…is there any reason not to use the latest? But it has no special needs beyond SDK 3.0. And be sure to get the latest version of cocos2d as well (although again…any recent version should be fine).
…Bill
Great news! Ill be testing this as soon as i can
In a word: wow! Just wow!
Awesome..Thats what we want…
Second all the wows.. you guys rock so much.
Amazing !!
Cocos2D behave “nice” combined with easy-to-use, free and good performance…and, now 3D?? wow! that’s what we are waiting for.
Very nice extension, making cocos harder and stronger like real “cocos”.
Awesome stuff! Really impressive and a sensible looking roadmap too.
Anyone else noticed that they needed to change a reference to CCColorLayer (from CClayerColor) despite using latest cocos2d?
(found in ControllableCCLayer.h when using the project template)
Epic, I love it. Thanks for all your hard work Brenwill Workshop!
Do i have to uninstall my current cocos2d framework in order to get the cocos3d? or can i still have both?
@johny
cocos3d is an extension to cocos2d. You need to have cocos2d installed in order to run cocos3d.
The README document in the cocos3d distribution explains how to run the cocos3d installation script.
…Bill
Is there any sample game available for download?
@jowa44
Not a full game. But check out the
CC3DemoMashUpexample in the cocos3d distribution. It covers most of the important possibilities.…Bill
great job! cocos rulez
Thank You!
Amazing work! I exported from maya via PVRGeoPOD and it worked brilliantly. I also exported from blender to collada and imported that into Collada2PODGUI and and that also worked. FYI, If anyone plans to use Collada2PODGUI on osx you have to open up a terminal and “chmod 755 Collada2PODGUI” for it to run.
Keep up the great work.
Pat
Excellent!
I have pasted the steps we have used to get a 3D Max object into iPhone http://sree.cc/iphone/iphone-3d-objects-how-to-using-3d-max-xcode-cocos2d-and-collada2pod
…Sree
Thanks for the 3D support.
Can you look at adding Lightwave 3D support.
Thanks
Thanks a lot for this engine.
Is there any issue tracking website?
Could you configure your doxygen to generate a class diagram picture? It is easier to understand the engine rather than reading class hierarchy.
Thanks!
@Ricardo1980
No formal public issue tracking yet. For now, you can either post issues to the cocos3d forum…or send them directly to support@brenwill.com.
Regarding your suggestion…do you mean a collaboration diagram?
…Bill
There were quite a few times when I wanted to add some 3D effects to my games. This is perfect for my next project! I was thinking something like this would be most useful in the context of a 2D game with some 3D elements (think 3D brick breaker, tetris, etc).
C4D support!!!
When I run the installation script the cocos2d libraries are copied to workspace correctly .. but as soon as the templates are to be created I get a “Permission denied” error.
What am I doing wrong?
@devindazzle
Which version of cocos3d are you using?
The cocos3d 0.6.0 version had an issue with the PVR 2.08 files in the template. The remedy is discussed here.
The cocos3d 0.6.1 release fixed this issue.
…Bill
Amazing work.
I was perusing through the various examples and noticed a very interesting use of PVRTexture in the PowerVR skd examples: “Polybump”.
I also noticed that apple has an example that loads PVR textures:
http://developer.apple.com/library/ios/#samplecode/PVRTextureLoader/Listings/ReadMe_txt.html#//apple_ref/doc/uid/DTS40008121-ReadMe_txt-DontLinkElementID_13
Since I am a complete newbie to Cocos3d, how can we use this PVR texture from Cocos3d.
Thanks.
Correction to my last post. It seems that the example: “polybump” is using “DOT3 lighting”. How can we use this in Cocos3d.
@rocknroll
Have a look at the purple head in the
CC3DemoMashUp. It uses DOT3 bump mapping.And check out the cocos3d forum for further help.
…Bill
Amazing work!
Cool! Amazing job. Very excited to look into cocos3d’s progress.
Bill,
We would like to get you some Android hardware to assist in your efforts on Cocos.
Please PM me
I’m new to all this and may be using the wrong terms, so I’ll describe what I want to do long windedly. I’ve built an animated model in Blender, usuing a mesh and an armature of bones, so that moving one bone deforms the whole mesh. Can cocos3d support that type of animation? Or might it soon? Or is there any form I might output the deformation animation from Blender that cocos3d can handle (perhaps separate animations of all the verticies)?
I can’t test anything at the moment because there’s no reliable way to export to POD with the current version of Blender, but hopefully PVRGeoPOD will be updated soon.
@Paul Gadiner
Excellent timing on your question!
cocos3d 0.6.3 was released today, and includes vertex skinning (aka bone rigging).
…Bill
[3D Showreel, Lighting, Texturing, Modelling, Rendering, Dynamic, Scripting, Animation etc]
My Link:
http://www.kapil-graphics.blogspot.com
http://www.pallavi-graphics.blogspot.com
http://www.vimeo.com/kanishq
could someone to tell how cocos3d resolve the obj file
e-mail:pill.gong@ceosoftcenters.com
@lingxhai
If you are asking how to read a model file in the .obj file format, cocos3d doesn’t support that file format at present.
Currently, cocos3d supports the POD file format. You can find out more about how to export POD files from your 3D editor in this article.
…Bill
It’s actually a nice and helpful piece of information. I’m satisfied that you simply shared this useful information with us. Please keep us informed like this. Thank you for sharing.
CraigOZ:
There is a native plugin available for Lightwave 9.6 which exports static meshes as well as skeletal/nodmal animations to POD format.
http://forums.newtek.com/showthread.php?t=114158&highlight=POD