Simple graphical project, satellite tracking / visualization
I would like to create a simple satellite tracking / visualization software with OpenGL, that would result in something like this :
( I did not produce and don't own the image, I found it by image searching )
It is basically a map of Earth on which points are projected, that represent satellite's position above that location on Earth. Of course these points move in time and create a line. I have the calculations part covered, I believe, but I don't know about graphical implementation.
I have C++ experience and no OpenGL experience. I have a video card that supports OpenGL 3.2 , but someone recommended me to use legacy OpenGL for such a simple project. I am little doubtful, because I would like to learn core profile, that will be of use for me in future too. But legacy coding is supposed to be much easier. Can I have your opinions on it ? And maybe some online resources / books / tips that will help me get the basics I need to complete my project ?
Thank you, it is much appreciated
Your project is extremely simple. If you want to learn modern OpenGL, then and only then you should use OpenGL 3+. But the development would last very long. Using legacy (fixed function) OpenGL would be faster and can be executed virtually on everything. But, if you want to achieve results in an hour, use some 2D API. You just need drawing a bitmap and few simple primitives like lines and circles.
> but someone recommended me to use legacy OpenGL for such a simple project
Maybe someone recommended just what he/she just got used to. New OpenGL API is even simpler than the legacy immediate mode: you fill a buffer with vertices to draw, attach this buffer to the context and call the draw command.
You see, that is why I am confused. You both gave me great answers ( thanks for that ! ), but different ones. And it is same when I do research on 'old' vs 'new' OpenGL on my own - I can't figure out the best option, and they both seem to be about equal with pros and cons. And I would like to use OpenGL because of its versatility and possible projects in the future. The part with " Using legacy (fixed function) OpenGL would be faster and can be executed virtually on everything " seems to be giving an edge.
Maybe you can give me additional comments if I let you know that next stage of my project ( after completing this simple one ) would be a Solar system simulation, resulting in something like this :
( again I did not produce and don't own the image, I found it by image searching )
Last edited by thor36; 04-19-2014 at 05:00 AM.
This is also fairly easy. Fixed functionality is easier (up to certain extent) but shader based approach is more flexible. If you are ready to learn, start with GL 3+, but be prepare to spend a long long time before achieving some result. But the next step to something more complicated would be much easier. Drawing a triangle or a pretty complicated mesh is almost the same in moder OpenGL. On the other hand, you can achieve same simple results much faster with legacy OpenGL, but maybe you'll come to a point where it cannot be used any more (for example, per pixel lighting). Maybe it is best for you to find some examples in both legacy and moder OpenGL and compare the code. You'll need a lot more accompanying libraries (or implement by yourself) if you follow the moder path. Everything you showed in the downloaded pictures can be quite easily implemented using legacy OpenGL.
And load new functions not exposed by windowing API, and make shaders for drawing, and make some shaders loading code, and make buffers for even the smallest primitives (or make them procedurally), and make and select VAO (even if you are not using it), and implement all maths for vector/matrix manipulation, and implement transformations, and ... Sounds simple, isn't it?
Originally Posted by nbdspcl
But, at the point when one has all this and achieves some skills, there will be no limitations. Shader-based approach is extremely powerful.
Alexandar thank you for your comments. I think this settles it, for now I will go with legacy OpenGL, and leave the modern one when I will complete these projects and have the luxury of more time. Now that you know what kind of results I would like to achieve with legacy OpenGL, can you ( or anyone else too ) point me to some resources that you recommend ( books & tutorials ) ? I have already been looking for them and found some, but as a beginner I may not do a good selection, and I probably missed some good ones too. I will be using C++ and CodeBlocks. Also, GLUT / FreeGLUT is used in most tutorials, but people recommend GLFW. Thank you for your help.
Last edited by thor36; 04-19-2014 at 07:09 AM.
What books and tutorials have you found?
For the beginning I would recommend OpenGL Programming Guide (pre-8th edition). There is also online version of some of the earliest editions. You need to read just first four chapters to get basic skills and a half of ninth chapter for texturing (you need it to draw a map). For the second phase (the solar system), you may need also fifth chapter (lighting).
I have found these :
- SuperBible OpenGL book on amazon
So far I have been checking swiftless tutorial. It seems ok, but texturing only shows how to load RAW images, and my map will be either JPEG / BMP / PNG / TIFF. And I will probably want to move from FreeGLUT to GLFW at some point. I would like my program to be able to run on Linux and Windows, with as little changes as possible before compilation.
Also I would like opinion from you about these two books I found, whether they would apply well for my project and which version would be more suitable :
- First one
- Second one
Last edited by thor36; 04-21-2014 at 08:35 AM.
As far as image loading goes, you could read up on each file format and make your own loader, or you could use a image loading library. A good lightweight, easy to use, cross platform one is SOIL, which can load BMP, JPG, PNG, and others more besides (though not TIFF). Another popular one is DevIL, which can load an even larger range of formats including TIFF, though it's slightly larger than SOIL.