Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Simple graphical project, satellite tracking / visualization

  1. #11
    Junior Member Newbie
    Join Date
    Mar 2014
    Posts
    18
    Thank you fiodis. I have already tried with SOIL ( I chose it over DevIL because I don't need such big library with so many supported formats ). But I get a flawed texture rendering. I tried it on a swiftless tutorial example with creating a sphere and binding bitmap Earth texture on it. With SOIL I get only upper hemisphere textured , and on one "meridian" an ugly texture "stitch" appears.
    Last edited by thor36; 04-21-2014 at 07:37 AM.

  2. #12
    Intern Contributor
    Join Date
    Jun 2012
    Posts
    71
    I'm not sure which tutorial you're using, but if you're using this one then it looks like the bottom half has negative texture coordinates. Normally texture coordinates range from 0 to 1. To go beyond that you need to specifically enable texture wrapping. See glTexParameter; you'll want to enable GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T. Swiftless has an example in their code following that tutorial.

  3. #13
    Junior Member Newbie
    Join Date
    Mar 2014
    Posts
    18
    Fiodis - yes that was the tutorial I was mentioning. And what you said was exactly what was missing in my code, thank you. If you are familiar with OpenGL literature, I would kindly like to ask you to give me your opinion on my post #9, while I am eagerly awaiting Alexandar's opinion. If you feel like it that is, so no need to bother with it if you don't =)

  4. #14
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    188
    I would like to create a simple satellite tracking / visualization software with OpenGL, ... someone recommended me to use legacy OpenGL ....
    I use legacy GL to do my satellite sims (which are animated). A screen grab is attached. Use gluSphere with textures activated to eliminate that ugly seam you're running into. I load bmps and tga files using code I grabbed off the web. I also use Devil to load images. Legacy GL is capable enough to generate the graphics you are interested in. I haven't tried to mess around with Modern GL. It looks like the learning curve is steep. If you were going to be a full time graphics application developer, it would be the way to go. If you're primary interest is in some other area (such as engineering), and you are doing graphics on the side, I'd recommend Legacy GL. The NeHe Graphics Legacy tutorials are good. There are lots of them, but you only need to do the first 6 or so for your application.

    Click image for larger version. 

Name:	Sat_Sim.jpg 
Views:	267 
Size:	94.1 KB 
ID:	1268
    Last edited by Carmine; 04-21-2014 at 02:03 PM.

  5. #15
    Junior Member Newbie
    Join Date
    Mar 2014
    Posts
    18
    Carmine, your project looks awesome. Close ( well, much better ) to what I expect to achieve some time. Is there a website with more information about your project available ? Also thank you for the extra tips in your post, much appreciated.
    Last edited by thor36; 04-21-2014 at 02:06 PM.

  6. #16
    Junior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    188
    Carmine, your project looks awesome. Is there a website with more information about your project available?
    Thanks. My work is not documented outside my company because it is being developed in a classified environment. But that should not discourage you. The 'look' of my graphics is result of practice, not graphics sophistication. It is done with basic, Legacy, GL - all of which is covered in the first 6 NeHe Tutorials. Orbit visualization software can be purchased from companies such as AGI (www.agi.com), which is one of the more sophisticated, thus expensive packages. A search of the web would probably yield less expensive packages.

    If you have no budget and/or want to do it yourself, it is fairly straightforward. Everything in my image is lines, polygons, and textures. The primary light source is the sun, with a secondary source to fill in darker areas. All of the user interface stuff is done with FLTK, which is free software.

    Good luck.

  7. #17
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,160
    Quote Originally Posted by thor36 View Post
    I have found these :
    - http://www.swiftless.com/opengltuts.html
    - http://lazyfoo.net/tutorials/OpenGL/index.php
    - 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
    Use tutorials just to get quick start and make the first application running, but then spend some time in getting basic knowledge from the books.
    OpenGL Superbible is quite OK. It is more "tutorial" oriented, while OpenGL Programming Guide is more "reference" oriented. It would be probably good choice to start with any of these. When I started with OpenGL (about 17 years ago), the Red Book (in electronic form on SGI workstation) was everything I could get about OpenGL. Later I got several printed versions. They still collect dust on the self. Maybe that's why I usually recommend the Red Book. Sentimentality or something like that...
    Unfortunately, it seems that the latest versions of both books are not as good as they used to be, or my expectations grew very high.

    Quote Originally Posted by thor36 View Post
    Carmine, your project looks awesome. Close ( well, much better ) to what I expect to achieve some time. Is there a website with more information about your project available ? Also thank you for the extra tips in your post, much appreciated.
    Your project is quite simple. You should be able to do it without any of the shelf solution.
    By the way, if you are trying to visualize real Earth, you should make an ellipsoid instead of sphere. The difference is small, but it would be more scientific like...

    Considering loading pictures, I recommend stb_image.c. The whole "library" in a single file. You couldn't get better portability.
    BUT, before go any further, consider using images in DXT1 format. Those format you mentioned is not good for 3D applications.
    You'll get significant speedup and reduction of memory space if you use some of the texture compression formats (like DXT1/S3TC).

  8. #18
    Junior Member Newbie
    Join Date
    Mar 2014
    Posts
    18
    Alexandar, I think I found the Red Book most suitable for me to start with as well. And I can see it has a very long tradition, close to my lifetime =) Do you ( or anyone ) have any idea where to get Red Book 5th and 6th edition code for download ?

    Difference between equatorial and polar radius of Earth is about 20 km, it would take an XXL screen with super resolution to notice the difference =) I understand your point though, but my project really isn't so much about details like that. Speaking of that, what algorithm do you recommend me to use to create a sphere that I can texture ( "create" Earth ), so that it will be efficient and decent looking ?

    I will try stb_image.c "library", thank you. But how do I go about using DXT1 / S3TC format ? How do I convert images from common formats to that one ? And what OpenGL functions use it for texturing ?

  9. #19
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,160
    Quote Originally Posted by thor36 View Post
    Do you ( or anyone ) have any idea where to get Red Book 5th and 6th edition code for download ?
    There is some sample code from the first edition, but I don't think you need it. As I said, build some sample application (from tutorials) and then try to add/change functions according to examples from the books or other tutorials.

    Quote Originally Posted by thor36 View Post
    Difference between equatorial and polar radius of Earth is about 20 km, it would take an XXL screen with super resolution to notice the difference =) I understand your point though, but my project really isn't so much about details like that. Speaking of that, what algorithm do you recommend me to use to create a sphere that I can texture ( "create" Earth ), so that it will be efficient and decent looking ?
    I know very well the shape of the Earth.
    I've spent years in implementing my algorithm for procedural completely shader based high accurate model of the WGS84 ellipsoid. Looking at the shape of the Earth solely one cannot distinguish it from the perfect sphere. But, since you want to visualize satellite paths, depending on the accuracy you need to achieve, an error sometimes is not negligible. Be aware of geodetic and geocentric latitude difference. I have no idea what formulae you are using, but they probably use latitude.

    If you want to create a sphere, it is best to use two nested loops (through latitudes and longitudes), translate polar to Cartesian coordinates and use triangle strips to draw strips around the globe (each strip from Theta to Theta+dTheta in latitude and from 0 to 360 degrees in longitude). Steps should be chosen according to your needs. This is quite acceptable up to about several km above the surface If you want to implement ellipsoid, the equations are different. (By the way, my implementation is far more complicated and I wouldn't start that topic right now. And it requires shaders heavily.)

    Quote Originally Posted by thor36 View Post
    But how do I go about using DXT1 / S3TC format ? How do I convert images from common formats to that one ? And what OpenGL functions use it for texturing ?
    OpenGL can compress textures automatically if internal format is set to GL_COMPRESSED_RGB_S3TC_DXT1_EXT (for DXT1/S3TC). Please read chapter 9 from the Red Book for details. Also, there are a lot of tools for offline compression.

  10. #20
    Junior Member Newbie
    Join Date
    Mar 2014
    Posts
    18
    Great to know that I am receiving help from an expert in the field What you are telling about your work sounds very interesting. Do you mind if I ask for what purpose have you designed such an accurate model of Earth ?

    Yes, the geodetic and geocentric latitude variance is another story and I will be careful about it. Whereas the exact shape of the Earth is not of essence for the orbit visualization. About the algorithm that you have just described me for creating a sphere - is it documented anywhere in terms of pseudo code or perhaps even better implemented in OpenGL already ? I can say honestly that I would like to save some sweat, time, nerves and errors with drawing a sphere, since the central point of my project are orbits and physical calculations of spacecraft motion - not to mention that I am beginner in OpenGL and that takes a lot of extra effort itself

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •