# How to achive this morphing sphere

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

## Recommended Posts

In these pictures in lower right corner can be seen a sphere that is changing its shape.

I wonder how I can build this sphere. Probably it is some kind of sin function or something similar. The direct link for demo is here.

##### Share on other sites

Maybe some function with Perlin noise would work or I though I could use some function with sin and some random values like A*sin(a) + A*cos(a) + A*sin(b) where A is some function of random values and interpolated and a and b are angles in spherical coordinates. Would something like this work ?

##### Share on other sites
Well, just play with it, that's what demo programming is about

I wonder if you need a random source here, let alone perlin. But yes, starting with a Sine wave looks appropriate. E.g. start with a sphere mesh and distort its coordinates like so:


x += amplitude * sin(x * k + time * omega)

Do this for each coordinate separately, using different wavenumbers (k) and frequencies (omega).

Or distort the polar coordinates (including radius).

Don't forget to post screenshots when you got something.

PS: Warning for others: Small demos use tricks to shrink the exe size, my virus scanner coughed. Then again: mea culpa