How to render ocean wave using opengl in 3D? [closed] - opengl

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How to render ocean waves using opengl in 3D? Any reply will be welcome.
Edit:
Is there any source code that renders ocean waves but not using an other sdk or api? It's difficult to learn how render it by read OSG source code maybe. So any tutorials about it will be ok, it is very good that it attach the source code.

Christian (above) is right. Currently your question is very broad and difficult to answer. You might want to do some research yourself and then ask a more targeted question.
Start looking at shallow water equations for example. (I'm skipping full fluid simulations here for the moment) Or read Tessendorf's "Simulating Ocean Waves". Or have a look at Cem Yuksel's wave particles. Even if you don't end up implementing any of it, the references will be a good resource for you. Another one might be this collection of links.
Not really a clear answer, but give us more to go on and we can point you in a more specific direction.

Rendering realistic looking water is extremely difficult. Luckily there are tools to make it easier, like OSGOcean, which can render some quite impressive waves.

Related

Massively struggling with laying out DirectX and windows [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have managed to get this example to work:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd370994(v=vs.85).aspx
My problem is that I am trying to structure the code there into something more understandable...
My first step is to remove all the stuff that's not absolutely necessary to lanching a window with a direct x surface... but as soon as I start messing with the code, I get massively confused at which components are core, and which are not...
Do you know of a kind of boilerplate project with literally the utmost basics in it for a directx surface in a window.
D2D is fine unless you suggest I just code straight in D3D... even though i'm only going to be drawing 2d stuff.
I've read so many resources and tutorials for directX but every blooming one has different bits and bobs placed in and it's so difficult to just learn what the "must" bits are!...
Just to help you with the question.
I have started by trying to create a Gfx object that will start and create surfaces and resources for direct X, I also tried to separate my windows code but ofcourse got a bit lost there too... Finally I wrapped up my Game class so that the windows loop just ran begin draw, render and end draw. in the tutorial above you have 2 brushes which as i'm not familiar with directX, I'm unsure if I can just whip them out completely or what?
I guess a step in the right direction is really what i'm looking for.
I very strongly suggest that you get hold of a decent book that can guide you through the steps:
For example - try to get a copy of this

Drawing lines with boost::gil? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need to draw some lines on an (off-screen) image. I'd like to use boost::gil because the lib is already integrated in my project.
I want to draw a line from start to end point in a 2dim array
Can anybody give me a quick example how to draw a line using gil?
Thank you.
GIL itself is very much concerned with storage of images and pixels in various formats and converting between them... but no more than that. user1929959's answer is using a GIL extension which facilitates interoperability of GIL with OpenCV and then uses OpenCV's line drawing (but OpenCV doesn't come with boost so you'd need to add that into your project too).
For high quality antialiased line drawing AGG and Cairo might also be worth considering (although you'd need to figure out how best adapt GIL images to their own image buffer types). But if you just want basic one pixel wide lines, consult any basic computer graphics text for some Bresenham's line algorithm pseudocode which could be trivially implemented using pixel-setting.
First take a look on boost::gil tutorial. You can find an example in drawing test, from where can easily extract method to drawing line.

Matching melodies [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to figure out an approach to compare two melodies to see how similar they are. Timbre doesn't matter. So if I had two recordings, one of a flute playing Happy Birthday and one of a Trumpet playing the same thing at the same pitches and tempo, it should consider them a match.
Is there a .NET or C++ library that can do this? If not, can someone give me an idea of what techniques I would need to do something like this?
Aubio has a C++ interface and several methods for performing pitch detection.
Since you are assuring that pitch and tempo will be the same and you seem to be ruling out harmonies, you can measure pitch over time and compare the two results.
Your comparison algorithm will require trial-and-error refinement. Keep in mind:
noise, timbre, and volume fluctuations can make the pitch at any moment a subjective topic
real-world performers can have similar pitch and tempo, but it's unlikely that they'll be perfectly the same.
The two songs may not start at the same moment in the recording.

How to add hair in OpenGL [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have a 3D head model. How can I add hair? I only need to draw hair and animation is not required.
Could anyone provide some sample code? What is the simplest way to simulate hair in this case?
Edit:
I understand this is not a programming problem. But I have to implement it as my project. I searched online, which makes me more confusing. That is why I asked here.
Static hair can be rendered in a variety of ways depending on your needs:
Using a polygonal model. This gives hair that looks like what the characters from Dragon Ball or Yugi Oh! have.
Using a fur rendering algorithm. This is a very fill-rate intensive process.
Using multiple disjointed polygonal models. This works well for dreaded hair and in general hair which isn't too "fluffy".
These are just from the top of my head. There are most likely other algorithms out there. Also, as cbamber85, hair rendering is indeed a research field in itself!

How can i render a tiled map with C++/SDL [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to render tiles to the screen from a text file. I have the random terrain generator working, and I can move the data from the text file to a 2d vector. What I'm having trouble with is understanding how to give those tiles the coordinates they need to be rendered at. How would I go about assigning each tile its own coordinates relative to the camera?
I suggest checking this lua tutorial on how create a tile engine in great detail. You'll learn much more then what someone will be willing to post here on stack. Tile Engines as you will see from this tutorial, requires more then just a few lines of code. After you learn it here, it shouldn't be to hard for you to translate it to sdl/c++. Just a thought.
Its a good starting place.