Jump to content
  • Advertisement
Sign in to follow this  

How to make a wavey sheet?

This topic is 3581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have created a plane in xz, and created a wave in 3D: Points[index].y = (float)(rand()%32768)/32768.0f; So now I have a wavy sheet but its static in time. I would like to change it in time with some random effect so that its perhaps not periodic. How can I do that?

Share this post


Link to post
Share on other sites
Advertisement
I just used cosf() and sinf(), and I maked it as a function of x (space) and angle or time.

Share this post


Link to post
Share on other sites
Try looking into perlin noise. It is repetitive, but only after a while. 2D perlin noise will give you a static heightmap. Use 3D perlin noise to animate the heightmap (the first two dimensions are the position, and the other one is the time).

If you really want to, you could even use 4D or 5D perlin noise to remove some of the repetitiveness.

The nice thing with perlin noise is that it will generate a nice smooth mesh while animating because it is continuous. You will not have any points appearing out of nowhere, they will grow slowly.

Share this post


Link to post
Share on other sites
I have made some noise but I dont know if its perlin noise?

for(int i = 0; i < height; i++)
{
for(int j = 0; j < width; j++)
{
pNoise[i*width+j] = (float)(rand()%32768) / 32768.0f;
}
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!