Space background in opengl C++ - c++

I am working on a solar system and I wanted to have the background filled with stars. What would be the most appropriate way to accomplish this? Is using skybox better then drawing individual pixels?
Any ideas on good tutorials that would help me with either of these? It doesn't have to be realistic. Something simple would work; however I also like to try something more realistic to see how it would look.

Related

How to draw a lot of 3D lines in Unreal Engine efficiently? (>10k)

So I have a project with a lot of data points that are tracked through time, around 10k. What I really want to do is draw a line through each data track. However, everything I have tried seems to really tank performance. I'm really not sure where to start with something this big. My first guess would be spline meshes but, I don't think it would be performant enough.
I've also dabbled a little bit with procedural meshes but, haven't been able to get too far with that either.
My next guess would be something in Niagara as that is how I am drawing the dots currently but, since ribbons can't be drawn on the GPU they aren't good option either. Maybe there is something like a line sprite that I can utilize? I'm not really sure.
I believe there is a way to maybe draw lines similar to that of debug lines which I think might work but, I don't really have a clue where to start on that one.
If anyone has any ideas or can point me in the right direction or have already done something similar I would really appreciate any help!

MOG2 background subtraction Parameters

I am trying to use the OpenCVs Background Subtractor class MOG2 to seperate a person moving infront of a camera. I got everything set up and working nicely. But the resulting mask I am getting looks something like this:
(default settings)
Now what I would like to get is something like this:
(bad gimp skills :D)
I have already tryed to mess around with the parameter described in the docu, but all I managed to accomplish was something the looked like a motion blur effect...
So I was hopeing somebody with a better understanding of the algorithm or somebody who has already done something similar might be able to help me!
Thanks in advance, Foaly
I am working also with that and what I've seen is that this algorithm needs a good calibration to accomplish that goal, because you should be aware that this algorithm try to put in the background some pixels that don't show changes, e.g. in your skin major part of the pixels have the same color maybe this is the reason. I recommend to you that use other kind of methods (using zncc) if you want to use an application like the one that is showed in your question.
So I guess this were our image processing skills come into play. The first thing I would do is make the lines on the image thicker and join it it. We can use the following:
1) I would want the lines thicker. Use Morphological operators tutorial on Morphological operators with Otsu's method. This paper worked for me when I did my ear biometrics http://www4.comp.polyu.edu.hk/~csajaykr/myhome/papers/PR2011.pdf
2) Fill in connected components using opencv and clean the image
3) Segment human profile

Playing with OpenGL

Just learning the basics of OpenGL for a class and was looking for something challenging and interesting to try and draw. Any suggestions?
Aiming to photorealism (just plain models, lights, materials, textures, etc.) is one thing, but what is even more interesting in my opinion is demoscene and all kinds of non-photorealistic effects. The idea of a demo is to program some nice animated graphics that automatically change from one effect to another or tell some sort of a story, and have a background music. Here you can find some videos. Just take a look at what some others have done and use your imagination. That's the funniest part of 3D programming in my opinion. Of course what you'll first program would be something extremely simple when compared to those videos on youtube, but everyone has to start from somewhere. Simple also doesn't need to be ugly. Some random suggestions:
mathematical shapes with sin(), cos(), etc.
alpha blending, especially addition blending (glBlendFunc(GL_ONE, GL_ONE);)
terrain rendering
read 3d model data from a file. (Wavefront .OBJ is a relatively simple one)
feedback effects with glCopyTexImage2D, which copies pixels from screen to a texture (in real life you shouldn't use this because it's too slow, but when learning the basics it's ok)
etc...
You might consider building an OBJ viewer. You will get the experience you're looking for, and it's a pretty good project for a beginning 3D graphics programmer, in terms of difficulty.
I believe opengl has built in shapes such as a teapot that you can call and have it draw. For starters, I'd stick with easy shapes like squares, circles, and cones. Try drawing a wireframe model first since that's the easiest, by using either quadstrips ,triangles or just poly lines. After you've gotten that down, learn to set up lighting and materials so you can draw a solid model.
At school we had a very interesting assignement to get started with OpenGL that I will share. The long term goal was to modelize a living room so you basically have to draw:
A table.
Two chairs.
A carpet.
A sofa
Some stuff that you might find interesting to add on the table for
instance a TV!
When you have all the things done, try to polish the scene a little bit by adding some lighting effects!
Hint: for all the objects you simply need to start with a basic rectangle. Then you can construct your scene step by step using translations/rotations.

Display image in opengl

I am fairly new to openGL. I have a 3d game that I have running, and it seems to go fairly well. What I would like to do is display an image straight onto the screen, and I am not sure the easiest way to do that. My only idea is to draw a rectangle right in front of the screen and use the image as the texture. It seems like there should be an easier way.
This is for menu screens, and things, so if there is a better way to do that as well, please let me know.
I would recommend setting up OpenGL for 2D rendering via gluOrtho2d(); then, load the image into a texture and, as you said, draw it to the screen by creating a polygon and binding the texture to it. A good example can be found here.
You've got the basic idea. The other obvious alternative is to use glDrawPixels() but I think you'll find the texture method has much better performance. If you're feeling frisky, you might also take a look at Pixel Buffer Objects.
Good luck!

How to use opengl to create cylinder effect

I would like to know how to create 'cylinder effect', like the top site feature in safari 4, here is a picture
http://www.macworld.com/article/139022/2009/02/safari4firstlook.html
Can you tell me what should i learn , how to get started?
I would start by working through the OpenGL tutorials on NeHe's website. You might also want to invest in the Red Book. Topics you'll be interested in: Geometry and texture mapping. I think NeHe even has an example of texture mapping on a cylinder.
Depending on what you hope to accomplish, you might be able to use the Visualization Toolkit to draw a texture on a cylinder in 100 lines of code or less. There's a bit of a learning curve to VTK (and OpenGL for that matter), but the vtkTextureMapToCylinder class and the TCL example of how to use it are good places to get started.
Please download iCarousel. It has many types of cylindrical effects in it.Use whichever is useful for you.