Cocos2d + Box2d or Chipmunk [closed] - cocos2d-iphone

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
OK, im trying to make an iphone version of a game i made here http://scratch.mit.edu/projects/techy/781198 is box2d or chipmunk better and where are some tutorials for each one

I prefer Box2d - I think it is easier to understand than Chipmunk. Here's a link to another question that lists many usefull resources:
Cocos2d Resources
Plus here are a few links to cocos2d / box2d tutorials:
http://www.raywenderlich.com/457/intro-to-box2d-with-cocos2d-tutorial-bouncing-balls
http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone
http://www.raywenderlich.com/475/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-12
http://www.raywenderlich.com/505/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-22
And a great book Ray is making that I think will be an awesome resource:
http://www.raywenderlich.com/2274/cocos2d-book-and-360idev
http://my.safaribooksonline.com/9780132180863
Hope these help - Happy coding!

Chipmunk is straight C, while Box2D is C++. There is also a new set of Objective-C bindings for Chipmunk, but they are not free to use commercially.
As I understand it, Chipmunk does not support Continuous Collision Detection, but Box2D does. This is important to prevent "tunneling" (objects passing slightly through eachother when moving at high speeds)
At the end of the day, from what I hear, they're both great. If you prefer C++ to C or need continuous collision detection, you should probably choose Box2D.
If you'd rather use a pure C library, go with Chipmunk.
I personally use Box2D and my experience has been fantastic so far.
Also, I think Box2D has a different (possibly larger) set of joint types, so that could be something to consider...

If you download the Cocos2d SDK, in the included project is a sample of Box2d and Chipmunk. Just open the Xcode project called "cocos2d-iphone" and look Box2dtest and Chipmunkdemo. Box2d is more powerful, but I think a little harder to use than Chipmunk.
Here's the site for Cocos2d: http://www.cocos2d-iphone.org/
Download here: http://www.cocos2d-iphone.org/download

Related

Using homography for a virtual monitor [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm currently working on a project where I need to create a virtual screen for feedback during a game
My program draws an image at a tracked position. What I wan't it to do is to have this image follow my 4 tracked points, so it scales and rotates.
What I need for this is to get the homography to work, and I'm sorry to ask this question, because I know there's a lot of different articles, and I've been trying to go through quite many of these, but they don't make much sense to me. The issue i'm facing right now is that I don't know how to.
I can get it to scale the texture or the content of the image but it remains the same format of height and width. It doesn't rotate it, right now since I don't have a update function for it yet, which I don't know how to create either. I need it to stretch the picture itself so it scales accordingly to the points tracked.
With this post I hope you can help me in the right direction for just scaling the format of my image accordingly, that would be a major break-through for me.
I'm using openframeworks with openCV and ofxCV addons in Codeblocks (C++) on windows 7.
There's some functions in the addons of ofxCv, I'm pretty confused about:
For instance, I have not much idea of how the "imitate();" works and what it does.
This neither:
"homography = findHomography(Mat(dstPoints), Mat(srcPoints);"
and the: "warpPerspective(origImg, warpImg, homography, CV_INTER_LINEAR);"
I'm not sure I'm using these correctly, and have had difficulties finding proper documentation on these, that makes sense to me.
Another thing I have doubts about, is the usage of matrices in regards to this task.
As you've propably already figured out, I'm really not an experienced programmer. Any help in the right direction would be much appreciated!
This is a paste of all of the code: http://pastebin.com/MFfJqGZ1
The most interesting part, or where I personally believe I'm missing something or have done something wrong is between line 199-223.
And heres the header file: http://pastebin.com/XfQySAmh
Thanks so much in advance
Best regards
Jesper

Need some help to choose beetween Allegro 5, SDL 1.2, SDL 1.3 or SFML [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I won't start a debate about which library is better, it would be against the rule, but more ask a series of technical question. When i ask if there is special technique, just say the name of the technique, or a link.
Don't forget, im comparing also SDL 1.2 AND SDL 1.3, not just one of those
Which library have multiple window support?
I already know the answer for SDL: SDL 1.2, no, but 1.3 yes
Which of those library are multi-threading safe?
Most of the speed test were done when SDL and allegro were using software acceleration, but now that SDL 1.3, allegro 5, and sfml use hardware acceleration, in terms of speed, how do they compare?
Which of those library can detect more than one keyboard press at once? Is there any special technique to do so?
Is there a way to integrate the result in a GTK window? If yes, is there any special technique? (I remember last time i used SDL 1.2, i wasn't able to do this...)
Which library has support for 3d? (using openGL)
If i use X library with OpenGL for graphics, will there be limitation, or more/less features available? (I mean, is using opengl for graphics the same for all those libraries?)
Which of those libraries can I statically link to?
And finally, are some of those libraries more toward a particular game style? (Like X library is better used when making RPG, while Y library is more used while making strategy game, tile based game...)
Don't forget about SDL 1.2 AND SDL 1.3
EDIT:
I will try to share everything i found out, from my research, feel free to contribute to get more answer to my question.
Multiple window: SDL 1.3, SFML
No multiple window: SDL 1.2
Multi-threading safe: Allegro 5, SFML
Not Multi-threading safe:
Speed: Unknown
More than one key-press support: SFML, Allegro 5

Creating 3D Models for a Game using Blender and Bloom Effect in Graphics [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am creating a game that requires heavy use of 3D Models. I started using Blender for creating models. Here are some models which I came across while developing a model
I need to create a model of a Cube with Horizontal Grooves/Depressions and impart glow to those Grooves. I went through a blender tutorial which described how to impart glow to certain objects but I don't how to create a Cube with Grooves/Depressions.
Second Question is related more to the field of Graphics. What is Bloom effect ? Is it related to lighting models in any way? How do I impart it using Opengl and C++ ?
I can only try to help you with your second question, since I'm not experienced with blender. A Bloom effect is a graphical effect to visualize strong light sources. It is often implemented as a shader. The wikipedia article is actually quite interesting.
You should be able to find tons of tutorials for both OpenGL and DirectX respective their shader languages. A quick search provided these, which look promising:
http://prideout.net/archive/bloom/
http://doenemeier.de/2011/03-opengl-bloom-shader.html

Good extensible project that will help me learn theoretical computer graphics? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I never got to take a computer graphics course in university, but I want to have a thorough understanding of everything you'd learn in that course. I figure the best way to learn is through practice (programming).
If I were to start an OpenGL program from scratch, and slowly build it up to add new features to understand all of the concepts, what would I cover? And what would be a good project to demonstrate this?
I'm the author of a series of tutorial on the subject :
http://www.opengl-tutorial.org/
Regarding your question on the concepts you'll learn, the table of contents can give you a good idea :
Basic OpenGL
Tutorial 1 : Opening a window
Tutorial 2 : The first triangle
Tutorial 3 : Matrices
Tutorial 4 : A Colored Cube
Tutorial 5 : A Textured Cube
Tutorial 6 : Keyboard and Mouse
Tutorial 7 : Model loading
Tutorial 8 : Basic shading
Intermediate Tutorials
Tutorial 9 : VBO Indexing
Tutorial 10 : Transparency
Tutorial 11 : 2D text
Tutorial 13 : Normal Mapping
Tutorial 14 : Render To Texture
Miscellaneous
Math Cheatsheet
Useful Tools & Links
Tutorial 12 is done by sb else and is not crucial; Tutorials 15 & 16 are on their way ( baked & real-time shadows )
Of course, you have to keep in mind that you can't get a 'thorough understanding of everything' without a big book. I suggest Real-Time Rendering 3 for a broad, but often not in-depth discussion of, well, almost everything, and an additional math book like Essential Mathematics for Games and Interactive Applications.
What's more, I second walkytalky's proposition of making a FPS from scratch. That's basically what we all did.
If you want to start with OpenGL, you can try Angel's books. Another very popular extensible graphics project is a ray tracer. For that, Suffern's Ray Tracing from the Ground Up is very nice and you'll learn lots of concepts.
If you do intend to build a single project and slowly expand it, I would not suggest any form of FPS. Indeed, I would look at any kind of game with suspicion.
The reason being that most games involve a lot of things that you're not interested in dealing with. Collision detection, physics, AI, real interactivity, etc. These are important for making a game, but the more time you spend on them, the less time you spend on anything else.
Honestly, I would suggest not doing your approach entirely. That is, you should not start with a single project and build on it. What you want is to understand graphics. Unless you are going to rebuild graphics theory from first principles, that means at least initially learning from someone else. Whether it is a book, website, etc, you need a firm foundation of math and basic skills to be able to start doing projects on your own. Doing so from the right materials will help you avoid many of the pitfalls that programmers often step in.
The OpenGL Wiki has links to many tutorials and other how-to guides for learning the basics. In the interests of full disclosure, I am writing one of the guides linked there.
What you should do, once you have a firm foundation, is say, "I want to learn about graphics technique X." So then you do some research on the subject. Maybe you ask some people on a forum or something of the like. Once you understand it, you build a new application to test it out and make it work. Then, you move on to graphics technique Y. And so on.
Once you have a solid grasp on how to draw something in particular, then you'll be ready to start on your single project that you slowly expand. That way, you will know something about how to structure your rendering system and so forth.
If you do insist on taking this approach, I recommend starting with some kind of top-down-esque game with limited interaction. Perhaps a puzzle game or something similar. The ground shouldn't be flat, but you shouldn't need to do significant work on collision detection either. That way, you don't have to do much with the "game" part of the game, and you can instead focus on the rendering.

How to create a transparent glass cup in OpenGL ES/OpenGL? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Is there a way to create a glass cup with OpenGL ES/OpenGl? And if it's possible, what can i read to start creating? Need to get the most realistic view of a glass, for example -
see glass cup image
For simplicity, without handles.
Maybe, anybody has example with sources?
Thanks.
Getting something that looks very close to the image you linked would be very complicated (the handle is not the hard part). If this is a learning project, I would suggest starting smaller. Rougher approximations would be a better starting place.
You can make a semi-transparent object easily in OpenGL ES. The OpenGL feature you want is Alpha Blending. This won't get you very close to your glass though. http://www.opengl.org/resources/faq/technical/transparency.htm
A basic level of replicating this object would be to use a hand-drawn grayish texture that looks sort of like the interior refractions and draw it on a camera-oriented sprite with partial transparency. Then render a regular cup-shaped model with high transparency with only a small amount of ambient and diffuse lighting and a lot of specular lighting to make it look shiny.
The multi-bounce refraction effect of a rounded glass object is much more difficult. Especially if you want it to look convincing when something other than a blank background is behind the cup. It's fairly straightforward to do in a raytracer, but not in a rasterizer like OpenGL. Look up Caustics. There are methods to approximate this effect but they are not beginner projects.
According to this there are some examples in GLUT if you're serious about it. http://www.opengl.org/resources/faq/technical/lights.htm
I know this post is over a year old , but i came across this post on the internet, which may help. (Its russian or whatever, use google translate to change it to english)
With programmable shaders it is possible to create nice glass effects, such as reflection combined with refraction. OpenGL ES 2.0 has programmable shaders, but OpenGL ES 1.X does not.
A good example of glass with OpenGL ES 2.0 comes with AMD RenderMonkey (free). Download here, and have a look at the glass examples.