Lighting and shadows with Cocos2D and Box2D - cocos2d-iphone

I am currently developing a game for iPad & iPhone using Cocos2d with Box2d.
It would have been majorly cool to achieve a lighting effect like the one in this video:
http://www.youtube.com/watch?v=Elnpm-gNI04
and on this link:
http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/
I could have a go at trying to replicate the effect with Cocos2d and Box2d from the description in the link, but I am unsure if I would be able to get very far. It looks pretty advanced and heavy.
How can I achieve this in an "easy" way? Does anyone know of a Cocos2d-version of something like this, or do anyone have some pointers to point me in the right direction?

http://code.google.com/p/box2dlights/
I have succesfully made dynamic light library that use box2d geometry and rayCasting. My library work under gles1.0 and gles2.0 and use libgdx as framework. This is peformant enough for giving dynamic real time lights to 2d games for mobile devices. I can help with porting that to Cocos2D. Basics are darn simple. It was under 100 lines when I first hacked it working for my own game.
Example:
Point light shoot from center n number of rays around it and record the closest collision points. These collision points are used for mesh that is colored with gradient and drawed with additive blending.

Try to look at this link.
http://www.cocos2d-iphone.org/forum/topic/27856
He successfully added simple dynamic light using cocos2d + chipmunk following the technique that Catalin Zima used.
Please note if you download his project and try to compile iOS build, then remove "Run Script" build phase as you may experience script didn't found error. More info to remove such phase can be seen here.

Related

How to make such animation in After Effects

I have the basics of AE but I don't know everything, I would like to make an animation like the one in the link, with phone, if someone can tell me where to find such tutorial then that would be great. The animation of the phone is my main problem, it looks like a 3d model in sketch style. https://www.planradar.com/wp-content/uploads/2019/05/iPad_EN-1.mp4
First of all you need vector paths for drawing the tablet/phone it the style you have shown. (like in this video https://youtu.be/zSlXOIsfjLY?t=123)
Next you just need to put that all in 3D via camera settings and each layer as an 3D object and work this out step by step.
I think you should find many examples on youtube for what you are looking for.

Water Waves implementation in cocos2d

I am developing a game(cocos2d+box2d), where I want to implement waves similar to below link,
http://jayisgames.com/cgdc8/?gameID=7
The above game done it using World Construction Kit for flash.
Is there any one ported similar thing to cocos2d, or any one knows how can i achieve similar using cocos2d, Please help me.
Maybe this tutorial will help you:
http://www.raywenderlich.com/3888/how-to-create-a-game-like-tiny-wings-part-1

Code to Graph XYZ coordinates

I need to graph XYZ coordinates in a 3D cube that I can rotate. Im look for code that will basically take a 3d array of 1s and 0s and build a cube. Coloring of the points would also be nice. The program that creates the point is in C/C++ so I would prefer something that would play nicely will that but Im not picky. Im alright aware that Mathematica can do this , but Im looking for something that can be "live" updated so I can watch the progress
Thanks in advance
One obvious possibility would be something like Direct3D (for Windows, X-box and Windows Phone 7) or OpenGL (for pretty much anything that can do 3D except X-box or Windows Phone 7).
There are quite a few libraries and sample code for things like this.
If you're working on Unix/Linux, you may or may not have OpenGL installed. If you don't, you might want to check into Mesa3D.
I would go with Jerry's suggestion of using OpenGL. There are some good tutorials out there too - have a look at the nehe series which have examples for doing precisely what you're after.
Refer this tutorial link : http://www.directxtutorial.com/
This will help you to implement three dimensional cube.

Is Box2D the best solution for my iphone game scenario?

I'm planning to build a basic rebound iOS game in Cocos2D. Will Box2D be best suited for the following scenario?
The layout will consist of a target at the top of the screen, with obsticles in the middle of the screen, blocking direct view of the target from the bottom. The user will shoot a ball from the bottom of the screen by rebounding it of the sides and around the obsticles, aspiring to hit the target. Similar to a breakout style of game.
As the game levels progress, the obsticles will be moving dynamically, left to right and back, up and down etc..
I understand that the collision detection can be achieved using Cocos2D alone. Can the rebounding and trajectory of the ball off obsticles and walls also be achieved without using a physics engine?
I will have no need for gravity in the game scenario. A reduction in the velocity/speed of the ball will be essential.
Please note, I am new to iOS dev, coming from a background in front-end web dev.
Advise and help much appreciated.
Thanks
You certainly can do all that without using an existing physics engine. Once you start doing collisions with moving objects and objects of different shapes, though, it starts to become advantageous to use an out of the box solution.
It's easy to setup box2d without gravity and it will give you all of the collision calculations and velocity stuff

How to use opengl to create cylinder effect

I would like to know how to create 'cylinder effect', like the top site feature in safari 4, here is a picture
http://www.macworld.com/article/139022/2009/02/safari4firstlook.html
Can you tell me what should i learn , how to get started?
I would start by working through the OpenGL tutorials on NeHe's website. You might also want to invest in the Red Book. Topics you'll be interested in: Geometry and texture mapping. I think NeHe even has an example of texture mapping on a cylinder.
Depending on what you hope to accomplish, you might be able to use the Visualization Toolkit to draw a texture on a cylinder in 100 lines of code or less. There's a bit of a learning curve to VTK (and OpenGL for that matter), but the vtkTextureMapToCylinder class and the TCL example of how to use it are good places to get started.
Please download iCarousel. It has many types of cylindrical effects in it.Use whichever is useful for you.