How can I chart 3d scatter graphs in C++? - c++

What is the best way to chart a 3D scatter graph in C++?
Or maybe it's easier to use an external programs. Can you recommend my anything?

Did you heard about ChartDirector. I used to use it but don't know if they have a 3D scatter chart. Try http://www.advsofteng.com/1

What you'll want is some form of GUI library - you could use, say, ncurses, but graphs in a terminal are rather difficult. Any GUI library will do it.
FLTK is the easiest to pick up and can definitely accommodate your problem, but GTK should also do it, along with wxWidgets et al.
Failing that, OpenGL is probably a hacky way to get it done!
Hope this helps.

Related

The simpliest way to visualize - easy-use graphics. Which languages and lib?

I'm going to develop math model of trafics simulation and will need to somehow vizualise it. The model will be in C++
I'd like someone to recommend me how can I visualise the result data file - e.g. paint cars, road etc. Language choose is not important but should be easy enough to go into.
os: Win32
UPD:
It'd better be the 2D not 3D
but actually - doesn't matter
Best quality and most general software I've seen is Graphviz.
http://www.graphviz.org/
I've heard lots of good things about VTK (not yet had the occasion to use it myself).
The Wiki contains lots of C++ examples.
Although I do not know how (or even if) it interfaces with C++ you may be interested in processing to quickly build visualizations.
If you want more 2D than 3D and if you know C++, then using Qt and notably its Qt Graphics View framework could be ok.

Easy to use drawing library in c or c++?

I'd need a very easy to use drawing c or c++ library. This means that I don't need to put buttons, frames or anything else in there, but I need just to draw points, circles, lines on a graphic window. Is that possible?
Cairo is a nice option if you are looking for ease of usage.
You can use one of the many C++ creative coding frameworks:
Cinder
openFrameworks
polyCode
If you are working on Windows, try Direct2D, it's very powerful and equally simple to use.
More info at : http://msdn.microsoft.com/en-us/library/dd370990%28v=vs.85%29.aspx
SDL is pretty nice. If you really want to get involved, Direct3D and OpenGL are probably the best options.
Try SFML: http://www.sfml-dev.org/
You should be a little more specific:
What platforms do you want to target?
What do you exactly mean by "easy to use"?
If you are using Windows and just want to learn the concepts of computer graphics, just use the Windows GDI.
If you want to learn computer graphics for mobile devices, use OpenGL. It is a bit harder to use than the Windows GDI, because it is a lower level API, but it is more powerful.
Anti-Grain Geometry has some really nice results. It's not difficult to use. It's a C++ library and I don't know if there are C bindings.

3-d animation in C++

I am doing a scientific project in C++ and I need to draw simple animated 3-d images of moving atomic groups. What is a good and convenient graphics library to do that? Some general remarks are also appreciated. I work in Linux.
Thank you in advance, Roman
OpenGL of course,
one library you could use is glut for that.
have a look on http://nehe.gamedev.net/
If you want to show 3D in linux, you should use OpenGL. But since it is a C library, you can use a wrapper, like for example glt or sfml
The easiest library to use is Vtk. A more difficult and slower, but potentially better rasterization can be achieved using POVRAY.
I suggest looking at game oriented graphics engines. They provide OO wrappers around openGL and have lots of utility functions for loading 3d model formats etc.
If you don't want to get bogged down in writing the graphics, a game oriented renderer is likely the fastest way for you to get stuff on screen.
Ogre may be a good choice - it has a fairly large and helpful community.
Irrlicht is another possibility.
There are several possibilities, some perhaps more suitable than others, obviously!
I think any one of the options mentioned above would serve to do so.
I personally recommend OSG.
http://www.openscenegraph.org/projects/osg

Animation with C++

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.

Mac dev - Help getting started with 2d games

I want to make some simple 2d games/clones (for Mac), but I have a few questions:
Should I use Quartz 2d or OpenGL (I don't plan to try 3d anytime soon)
There seems to be a lot of typedef'd things like CGFloat/GLfloat, which should I use?
Should I use Objective-C for the game too (classes) or just C? (I assume I'll use Objective-C and Cocoa for window and views.)
Is it fine to redraw the entire view each time? I don't really understand how the NSView's -drawRect dirtyRect parameter works, how does it know what I want to update?
Are there any good tutorials for this?
Thanks.
Quartz or Core Animation vs. OpenGL really depends what you're trying to do. If you want simple drawing and animation, use Quartz or CA. If you want fast/powerful games, use OpenGL. Eventually I'd suggest learning both.
For the typedef'd things, use whichever is meant for the specific system you're using. For Quartz/CA/CG, use CGFloat. For OpenGL, use GLfloat.
Objective-C vs. C also depends on the speed you want. Objective-C adds a little bit of overhead but will (obviously) let you create much more object-oriented games. I'd suggest using Objective-C if you use Quartz and Core Animation, and either Obj-C or C if using OpenGL. However, if you're doing this on a Mac (e.g. not for iPhone), you probably won't see much difference unless you're doing complex fast drawing.
I'm not entirely sure about drawRect, but this question has some information which may answer that question for you.
For an intro to Quartz, I'd recommend this tutorial, and I've always heard the NeHe tutorials recommended for OpenGL.
If you use SDL with either Cairo or OpenGL, you get virtually the same programming model, but you get cross platform compatibility virtually for free. You should even be able to continue using objective C for the bulk of the game, if you want.
How graphically intensive do you want to get? Cairo will probably be easier to just get going with for 2D.