Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I need to draw a scientific graph (for example, a line or bar graph) and then render it in my application, which uses OpenGL for all display-related purposes.
What is the best way to do this?
Does anyone know of a plotting library for OpenGL?
I haven't been able to find one, and the best thing I've come up with so far is to use LibGD or PlPlot to render my image, save to PNG, and then load that same PNG as a texture for an OpenGL quad. Does anyone have any suggestions for a better way to to this, or know a library which could help with my task?
MathGL is cross-platform GPL plotting library which can use OpenGL for drawing (class mglGraphGL).
However it can produce a bitmap (or vector EPS/SVG) too. It is rather fast and don't require windows (can be run in console).
Rendering to PNG and using this as a texture is actually a reasonable way to solve your problem. If you need a "better" way, all depends on what you consider "better". If it's about scalable graphics, use the SVG output of PLPlot and render the vector shapes directly in OpenGL. If it's about avoiding intermediate files, you could extend PLPlot (LGPL licensed) to pass the data as a chunk in memory.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Hello fellow programmers. I've been to school and learned various things about graphics programming. But one thing we didn't learn, was which libraries were aviable. We mostly looked at OpenGL so that's what I've been doing the last weeks. Learning the modern version.
The thing is that I've come to think that OpenGL doesn't offer the easiest way of loading 3d animated models. And everything seem very, from the ground up... But I guess that is to expect, as OpenGL is a very low end library.
But I'm looking for a library that can load 3d models easily. As I've tried setting up my own, and it's not having the best of progress. And I'm willing to bet that someone else have already made an easy solution that beats my work by a long shot. I tried looking at the wiki page for 3d libraries. But there are so many to choose from... Any reccomandations?
You can use Lib3ds.
Also GLM can be used to load models.
My recommendation would be to use some scenegraph like OpenSceneGraph if you are looking for some serious application development in OpenGl. OpenSceneGraph supports wide array of formats through plugins.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a library I can use for C++ or MATLAB so that I can do some rigid-body and particle simulations which I can then render and view.
I'd like to be able to use a library to draw particles or rigid bodies and then programmatically specify rotation, translation, etc.
Additionally, I'd like for the library to have the smallest learning curve possible.
Thanks in advance for your help!
Use Open Scene Graph in c++:
http://www.openscenegraph.org/projects/osg
That library wraps openGL and allows great rendering and has some really good tutorials.
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials
You will be able to define objects positions by their transform from the 0,0,0 frame allowing to to move objects easily in a physics emulation style.
Hope this helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am creating simulation that models how an gas behaves in a container. I have collision checking set up, however I would like to draw the data on screen to make sure it is working correctly
All I need is a simple way to draw simple shapes such as circles to the screen using c++. these shapes do not have to look great, just function.
I may want to move my simulation from 2D to 3D in the future as well - so a library that has 3D capabilities would be good.
Remember I will be looping through and drawing several hundred gas molecules, so fast would also be good.
I am fairly new to c++ as a language so go easy. My IDE/compiler is VS 2010 Professional.
I have already used google - but I can not find any good installation guide for installing the library. So an installation guide would be a big plus
Look at SDL with SDL_gfx. You can then switch to SDL/OpenGL to do 3D.
I would recommend OpenGL, it's easy to use for your task. Also it's cross-platform and you can easily switch to 3D.
OpenGL is one possibility, though there are also other libraries built on top of OpenGL that might be useful as well.
Edit: OpenGL itself is installed as part of the OS. Headers and libraries for OpenGL 1.1 are included with VS 2010, so if you don't need newer features, you're already set. If you want to use newer functions, you probably want to use GLEW or GLEE.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I have been trying a couple libraries to load/parse my .obj model into my opengl program.
Here's some of them:
nate robins, GLM
obj2opengl(farthest one) by heiko
also a few other loaders that didn't work.
My main problem with these were undefined errors. And since I tried GLM from many different people (editors of the original code) then maybe it's something I'm doing wrong.
So my questions are:
What obj loader should I use for opengl (PC type)?
If I were to parse the obj file myself, then how should I save the vertices?(the fastest/most efficient) also choices with pros/cons are even better
I'm using Code Blocks/MinGW on windows 32 bit (7 and vista).
You might be interested in the (unfortunately named) Assimp library. While it is not a (fast) parser in and of itself, you can use it to produce an easy to parse format that contains only the data you are using, and it can load a lot of formats.
If you wish to parse the file yourself, it helps that the OBJ file format is very simple. I reccomend taking an equally simple approach - just bring in all the vertices into a vertex buffer and create an index buffer to use. Then render using Vertex Buffer Objects / Index Buffer Objects and just draw indexed triangles.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need to plot my simulation (which I do in a C++ application) for use in a Latex document (so I would prefer some vector output like EPS). My function is of 2 arguments, so I am after a 3D plot, ideally with colouring indicating the function value (similar to what Mathematica does). Could anyone recommend any library?
Why not use gnuplot? I use it for this sort of thing. If you really need a library, then I'd look at gnuplot++
MathGL have large set of 1D (curves), 2D (surfaces) and 3D (volume) plot types. It also have export to EPS and parse some of TeX formulas.
Take a look at QwtPlot3d (http://qwtplot3d.sourceforge.net/), if you can use Qt in your project.
(Basically it is OpenGL rendering library, but AFAIK it has ability to produce EPS output)
PS.I had never used it, but have experience in QwtPlot (related 2d ploting library), and it is pretty well designed and flexible library.
Edit:
From features list of this library:
"..."
"- Vector output (PostScript, EPS and PDF) via gl2ps"
"..."