Showing posts with label cell. Show all posts
Showing posts with label cell. Show all posts

2011/07/16

Weird Voronoi Pro

Finally, I published my professional version of my live-wallpaper. Currently (while I'm writing those words), the live-wallpaper is not available on the Market, BUT NOW IT'S AVAILABLE. I think there's a delay before a paid apps is officially available (I hope it's not too long).

The big changes compared with the free version is the number of functions. First, you can choose a "ratio" as a basic value. For each pixel, before determining its color, the three closest points (according to the distance function used, not necessary the straight line) are found. Let d1, d2 and d3 be those distances. In the free version, the only ratio that exists is d1/d2. Which is the basic one used to draw Voronoi diagram. The background used on this blog is drawn with that ratio. Remember that where there's a Voronoi's edge, it means that two points are a the same distance, so d1/d2 = 1. If the pixel is right on a point, then d1/d2 = 0.

But in this new version, you have access to other ratio, like d1/d3, d2/d3 and (d1*d2)/(d3*d3). You, currently, have 11 choices for this. And the ratio influence the shape of the cells. For the color, only ratio using d1 and d2 make sense. All the other creates weird interaction. But some people might like it.

Second, the functions. For now, the function used to compute the distribution of the color consist of 4 steps. Let R be the ratio, then you have:

  1. x = f(R)
  2. y = f(x)
  3. z = f(y)
  4. c = f(z)

where 'c' is the value used for the color. For each step, you can choose among 55 functions (but let say 54, because if you choose f(R) = 1, then you remove a lot of choices). The default function is f(R) = R.
So, if we consider all possible choices (and ignore those that opposed each other), you have 54^4 possibles functions with 11 ratios. Therefore, you have 93 millions functions available to you.

NOTE that all function are f:[0,1] -> [0,1]. So, by restraining to this interval, it's easier to control at each steps.

Among the functions, there's some that use [?] and [!], two values between 0 and 1. These are values controlled elsewhere in the computation.

  • [?] is a random value that changes for each frame rendered. This value is not stable so it creates effects that some time might look like lightnings.
  • [!] on the other hand is more stable. It's a wave that follow the positive values of a sine. Therefore, it goes from 0 to 1 and then from 1 to 0. It can be used to have a regular effects over the color distribution. By default, it takes 4 seconds to have a full cycle, but it's possible to change the speed.

Here's the qr code and the direct link:

https://market.android.com/details?id=com.blogspot.widgg_research.WVP

Here's some screenshots:



The settings for the function. From the settings, click on "Functions" then "Cell and Color functions". You can see the selection of the ratio first followed by the four steps of functions.





I also post an update for the [!] feature. First, I was using the function sin(pi * t) where t is in [0;1]. But I forgot that this function is not continuous on the first derivative. This mean that at some point, the transition was not very fluid. It was following an half-circle and going fast on the 0 and took a lot of time around the 1.

Therefore, I changed it to cos(2*pi*t) * 0.5 + 0.5. With this, the function is still in the [0;1] range but the transition is very smooth. There's no drastic, unaesthetic, changes. All of this because the this function is continuous on the first derivative.

2011/07/08

merging voronoi

Here we are playing again with the Voronoi diagram (VD). We wanted to see what happen when sites are merged together (MVD, merged VD).

VD partitions the plane in cells where each of these cell represents the closest part of the plane to a particular site. So, if you have sites on a map of various fast food restaurants, the Voronoi diagram tells you which one is physically the closest to your location.

But imagine that we want to consider all restaurant from a particular chain as one entity. We want to know the influence or the domination of a particular chain.

The following images are in pair. The first one is the influence of a chain of restaurant and the second is the actual VD that everyone knows. Cells with the same color represents a chain of restaurant.





In the images, you can see some brighter points (particularly in the first two images), this is the actual location of the site (or restaurant for in our example).

And just like the VD is well known for its role in texture synthesis, we hope to find a way to use the MVD to create some interesting results.

As for the diagram itself, we don't really know what to do with it or how to interpret it. VD has a dual graph called the Delaunay Triangulation. But what would be the dual graph of MVD ? Where do we put the edges ? That's an open question.

2011/06/14

Live Wallpaper

Playing with texture can be very nice. But when your objective is to find ways to generate them and to generate them, you need to find various methods to place points and other parameters, you notice that if some points or parameters changed a bit, the texture looks almost the same, but with a little difference.

Therefore, being able to change those parameters a little bit at the time, we are able to create animations. So instead of a static texture, we have a texture evolving with the time. And if it's done properly, this animation won't be the equivalent of an animated GIF that repeats itself forever. Each new images is unique and to have a close loop over that animation can take a while.

Live Wallpapers are a feature available sine Android 2.0. It allows you to put a wallpaper with some sort of animation, and some times interaction when you press on the screen or move your phone (if there's an accelerometer on it).

Here's some statics images produced earlier that can be converted into an animation for the live wallpaper:






Right now, there's no official date for a release. I'm taking my time to develop it properly, to be sure it won't drain batteries and it will be smooth enough.

With the limited power of a smartphone, the number of points used to control the data would be much lower. In the previous images, there's around 64 points, more or less... sometimes much more. But on a phone, 4 to 16 points might be the top. But what is important is to have enough options so the users can create the live wallpaper they want.

More information about this soon!