| Author |
Mike?.....coding question. |
Nephilim
Joined: Feb 28, 2002 Posts: 165 From: Enschede, the Netherlands
| Posted: 2002-08-14 11:44  
Mike, how have you created the waves
in your sim? Do you use an algorithm,
and if so....can I see it?
I've been playing around with various
algorithms, but they all look so....
mathematical.. Not wavy...I need wavy
 
|
Monophonic
Joined: Feb 28, 2002 Posts: 279 From: Espoo, Finland
| Posted: 2002-08-14 13:06  
I'm not Mike, and I haven't programmed waves, but I'd look into Perlin noise for that one.
A couple of links for you to start, find more with google:
http://www.kenperlin.com/talk1/
I believe he's the guy who gave it his name.
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
http://astronomy.swin.edu.au/~pbourke/texture/perlin/
 
|
Manuel Ortega
Joined: Jul 23, 2002 Posts: 184 From: Alicante - Spain
| Posted: 2002-08-14 13:55  
Designing a realistic wave algorithm from scrath can last all the time you have planned to spend your subsim. The most realistic water algorithms have been created in 2 years minimum by professional programmers and mathematicals. A minimum of matrix algebra is required to do a water simulation.
However there are various tricks to avoid the mathematical path. A 2D matrix based in Perlin noise can be a possibility, but the problem is programming an algorithm that uses perlin noise functions in real time (CPU speed is the problem). One method very used consists in using height maps. You previously make texture bitmaps with Perlin noise (or any other kind of noise) that simulates the ocean seen from above, and save them in a sequency of images. Then you apply them to a 2D matrix, and the lighter the color, the higher the height of a vertex is. A disadvantage of that can be the repetitorious movement of the water. But is less complex than mathematical methods. I will probably use something like this, but I haven't focused yet in my 'water algorythm' (it's only a 2D vertex matrix that applyies a cosine function to their height).
Good luck.
_________________
Current Status: Pre-Alpha - 9%
R1L web page:
http://uboat.cjb.net
Manuel Ortega
 
|
Nephilim
Joined: Feb 28, 2002 Posts: 165 From: Enschede, the Netherlands
| Posted: 2002-08-14 14:11  
Thanks for the advice. I will look into it.
I started with sines, like you..but as said,
that looks too artificial.
 
|
Mike 'Red Ocktober' Hense
Joined: Feb 28, 2002 Posts: 282 From: NY USA
| Posted: 2002-08-14 17:39  
It's not that hard to do... just a little difficult to conceptualize.
In 3DRAd I am using a 16x16 matrix and looping through the matrix applying a sine wave to each vertex, advancing the sine curve as I iterate through the vertices...
A lot simpler to code than to explain...
If you are considering using 3DRad to do your sim, I have already posted a realistic water 'resource'... the same code that I am using in the sim... no royalties, no nothing...
If you are using VB or C++ the algorithms are out there all over the place... Visit the NEHE site (OpenGL), I think I remember a code tutorial there...
--Mike
--Mike
[ This Message was edited by: Mike 'Red Ocktober' Hense on 2002-08-14 17:41 ]
 
|
Deamon
Joined: May 10, 2002 Posts: 620 From: Germany
| Posted: 2002-08-14 20:44  
Quote:
|
On 2002-08-14 17:39, Mike 'Red Ocktober' Hense wrote:
...Visit the NEHE site (OpenGL), I think I remember a code tutorial there...
|
|
What's the URL of this Site Mike?
 
|
Deamon
Joined: May 10, 2002 Posts: 620 From: Germany
| Posted: 2002-08-14 21:18  
Hey thanks this is good information for my Project!
 
|
Manuel Ortega
Joined: Jul 23, 2002 Posts: 184 From: Alicante - Spain
| Posted: 2002-08-14 21:41  
Quote:
|
What's the URL of this Site Mike?
|
|
Nehe Productions:
http://nehe.gamedev.net/
Also try this one for more examples (in the OpenGL/Demos Section:
http://romka.demonews.com
_________________
Current Status: Pre-Alpha - 9%
R1L web page:
http://uboat.cjb.net
Manuel Ortega
 
|
Mike 'Red Ocktober' Hense
Joined: Feb 28, 2002 Posts: 282 From: NY USA
| Posted: 2002-08-15 07:29  
Yeah... that's it...
Thanks Manuel
--Mike
 
|
Deamon
Joined: May 10, 2002 Posts: 620 From: Germany
| Posted: 2002-08-15 10:45  
Yeah thanks this is good.
Ahh and Mike how the interview is going?
 
|
Nephilim
Joined: Feb 28, 2002 Posts: 165 From: Enschede, the Netherlands
| Posted: 2002-08-16 09:54  
Okay,
I've developed a few theories now on how
to create a bit water that will A- look
good in my game and B- won't be too much
work to create and C- won't be too heavy
on the system...
 
|
Manuel Ortega
Joined: Jul 23, 2002 Posts: 184 From: Alicante - Spain
| Posted: 2002-08-16 14:30  
Good luck in your Quest for Water Coding. What language are you using finally? Are you developing your own engine?
_________________
Current Status: Pre-Alpha - 9%
R1L web page:
http://uboat.cjb.net
Manuel Ortega
 
|
Nephilim
Joined: Feb 28, 2002 Posts: 165 From: Enschede, the Netherlands
| Posted: 2002-08-17 05:30  
No, I'm using a third party engine;
The WildTangent Web Driver. You might've
heard of it.
If you're interested you can look on
www.wildtangent.com to see what the
engine can do.
The language I'm currently using is
JavaScript. (Don't laugh!)
I might switch to Java at some point,
but that depends on a number of things.
The current status of my project is
as follows:
I'm still having a little difficulty
with loading the terrain correctly,
but I'm getting terrain on screen
(though not quite the way I want it).
I added a transparent water layer,
but it's not waving yet. For the waves
I will use the same system as I do
for the terrain, so I can't add waves
until I fix the problem I mentioned
above...
I can post an early screen shot tomorrow or
early next week..
 
|
Manuel Ortega
Joined: Jul 23, 2002 Posts: 184 From: Alicante - Spain
| Posted: 2002-08-17 07:17  
Yes, I see Wildtangent has a lot of options, and you save a year of work building a basic engine. But my objective is learn game design theory and OpenGL, so I'll continue with pure C++ . Will your sim be online? or are you developing it as offline application?
_________________
Current Status: Pre-Alpha - 9%
R1L web page:
http://uboat.cjb.net
Manuel Ortega
 
|
Nephilim
Joined: Feb 28, 2002 Posts: 165 From: Enschede, the Netherlands
| Posted: 2002-08-17 08:02  
I'm developing it as an online application,
but since it will probably be too heavy
to load on a website, I will make it
available as a download.
 
|