I want to draw 2D shapes in C++, probably not more advanced than rectangles!
I'm looking for a C++ API that will be simple and easy to use, as I don't need many advanced features such as image mapping etc.
I've read about cairographics.org Cairo and it looks very good. Before I start with it, would you recommend a possible alternative, or improvement on Cairo? I'm developing on Windows in VS 2013.
Thanks.
Related
I have a vectorized Adobe Illustrator image that I would like to animate using custom xyz input (in this case simulated plot points that I would like to visualize over time, using a hand drawn picture/wireframe model) from e.g. a c++ program or perhaps even javascript application. Is there any (fairly straightforward) strategy to achieve this? E.g. using open GL or some other (open source) tool?
If you want to draw vectorized images you would need to use vector image renderer. The easiest way to do this is to use Flash since it has support vector drawing (one of the best) and really strong scripting language to do all sorts of things (anymate stuff based on input, etc) even 3d graphics.
The hard way of doing this is to use a custom library in c++ do draw vector grapics in opengl or directx. I can only speak of gameswf (opensource player for flash files) or scaleform. There two have support for swf files exported by flash. If you only need a renderer without any animation then there should be plenty of libraries out there (check out this thread)
Where can i get some advanced game programming resources for c++?
At http://gamedev.stackexchange.com ?
More specifically, this question and lots of others tagged with c++
Start with writing some simple 2D games, e.g. Snake, TicTacToe, etc. Write these using any GUI builder you're already familiar with.
Then try to rewrite these games using a serious graphic engine, e.g. SDL, OpenGL, or DirectX.
Then try to write a more complex 2D games, e.g. side-scroller. Write these games with the graphic engine of your choice.
Then add some simple 3D effect to your 2D game, e.g. parallax scrolling.
Then rewrite this effect with true 3D, use 3D models/sprites, 3D environment, etc, while maintaining a 2D look and feel.
Then add some simple 3D look and feel, e.g. allowing characters to move in the Z-direction (to/from the camera), doing camera rotation, etc.
If you just got out of the command prompt and simple GUI, you'll probably want to start simple.
I'd very much recommend OpenGL as your API of choice. Since you've done some simple GUI programming, you'd know what an API is.
OpenGL has the following advantages (compared to SDL and DirectX previously mentioned):
-Its hardware accelerated (SDL is not as far as I know)
-Its 3D (SDL is 2D)
-Its cross-platform (DirectX is Windows only)
By far the best place to start with OpenGL is the Nehe tutorials.
http://nehe.gamedev.net/
Game programming becomes evident once you become a bit more familiar with the API.
Also, I'd heartily recommend GLUT (OpenGL Utilities Toolkit). It simplifies window creation and user input handling, among other things. Its great for learning OpenGL. It also happens to be cross platform.
Here's freeglut, a free GLUT implementation:
http://freeglut.sourceforge.net/
OpenGL is also a relatively simple and easy API to learn. You'll be going into 3D in no time.
What libraries are you using? You can try GP wiki. It can be a bit hit and miss depending on what you want to use.
By "resources," do you mean tools? Libraries? Tutorials? I have a bunch of useful game developer links in the sidebar of my own site. I also think "Mathematics for Game Developers" was very helpful. It has a second edition as well.
What do I need to know and what libraries do I need to use if I like to
build simple 3d editor ( like Xara3d for example ) that lts me edit simple 3d objects
and the end result will produce me good quality Ray Traced image .
simplicity in mind I will use any free lib that abstract and ease the learning curve .
in c++
Get familiar with OpenGL. Checkout the many C++ GUI toolkits that have excellent support for 3D rendering, which is usually built on top of OpenGL. If the abstractions they provide does not meet your requirements, look at C++ libraries that provide better abstractions.
Also see:
The Open Scene Graph project
A list of C++ game engines.
is there anyway to build rich animation with C++?
I have been using OpenCV for object detection, and I want to show the detected object with rich animation, Is there any easy way to realize this?
I know flash can be used to easily build rich animation. But can flash be reliably integrated with C++ and How?
Also, Can OpenGL help me with this? To my knowledge, OpenGL is good for 3D rendering. But I am more interested in showing 2D animations in an image. So I am not sure whether this is a right way to go.
Another question, how are those animations in augmented reality realized? What kind of library are they using?
Thank you in advance.
Its difficult to tell if this answer will be relevant, but depending on what sort of application you are creating you may be able to use Simple DirectMedia Layer.
This is a cross-platform 2D and 3D (via OpenGL) media library for C, C++ and many other compatible languages.
It appears to me that you wish to produce an animated demo of your processing results. If I am wrong, let me know.
The simplest way to produce a demo of a vision algorithm is to dump the results to a distinct image file after each processed frame. After the processing session, these individual image files are employed to prepare the video using e.g. mencoder. I employed such procedure to prepare this.
Of course, your program can also produce OpenGL. Many people dealing with 3D reconstruction do that. However, in my opinion that would be an overkill for simple 2D detection. Producing flash would be an even greater overkill.
I'm searching a simple 2d scene graph written in c++, possibly on top of OpenGL but that's not mandatory: the perfect thing would be the Cocos2d/Cocos2d-iphone scenegraph in c++.
Do you know of any existing implementations?
Here are a few ideas:
SGL - It is designed for 3D scene graphs, but also might support 2D. The website looks pretty informative.
Papyrus C++ Cairo Scenegraph Library
y60 by artcom might have 2D stuff, too.
OpenSceneGraph handles both 3D and 2D Scenes and sits on top of OpenGL. We use it here at work and have gotten a lot out of it. Quite powerful and multi-platform as well.