Showing posts with label art. Show all posts
Showing posts with label art. Show all posts

Live Backgrounds

As a side project I decided to do something android-related. Since it seems I'm not good at making anything but fun visualizations, I had the idea to make some live backgrounds, which the Android platform now supports. I have a few concept sketches that I'll try to bring into reality. I suspect I'll package 3 live backgrounds together in a free download on the Market and create a paid ($0.50 - $1.00?) download to give access to all future backgrounds that I make. Here's a sample of my first background below. It's been configured two different ways to give different effects.



I am aware that there is some wobbliness to the arcs. There are a few things I noticed that need to be fine-tuned that I can't recall at the moment. This visualization was just rendered on a PC using standard Java constructs. I still have to port it over to the Android platform and use their drawing API. At that point if it's still looking wobbly I'll find a way to work that out. Look for more previews in future posts.

Nominal Progress

We bought the domain name "daftgenius.com" and designed our logo!
Hopefully you get it if you've heard of the potato battery (a common kids' science project).


Also we have a few projects coming up in the future which we'll post on soon.
One is a game, and one is an engineering project... Hint: aviation.

Drawing Amoebae Part 2

Now that we have points which move in an amoeba-like pattern we need to be able to draw a smooth and continuous curve through these points so that our amoeba's outline looks realistic. To do this we will use the built in quadratic curve primitives provided by java. A quadratic curve takes three points. A beginning point, an end point, and a control point which will cause the curve to be stretched in its direction. It works exactly the same way as the curved line tool in MS Paint.


For the amoeba, these beginning and end points will not be the nodes themselves, but rather the midpoints between each node. Then we will use each node as a control point stretching the line between each midpoint to it's left and right. In the following picture, nodes are the large circles and midpoints are the small circles.


You can see that the cubic curves become continuous when you use midpoints as the beginning and end points. Using this approach we obtained a very good looking amoeba outline.

Drawing Amoebae Part 1


We've just started working on a simple Android game related to "the cell." We only have a vague idea, at this point, of what the general premise of the game is, but one of the graphics requirements is the ability to draw a dynamically moving and undulating amoeba with smooth graphics. So this is how we went about doing it.



To start, the outline of the amoeba consists of 20 or so evenly spaced nodes shaped as a circle. Here we will only show a few for simplicity. To get the locations for x number of nodes around a circle we use basic trigonometry.
increment = 2PI / numPoints;
For each point calculate the angle:
theta = i * increment;
To get the x and y locations from this angle use:
x = radius * cos(theta);
y = radius * sin(theta);




In order to keep the amoeba at a generally-similar size and shape it will be bound by somewhat of an exoskeleton. So at each of the previously calculated locations we create a node representing a piece of the exoskeleton which will not move or be visible (dotted) and an actual node mass which moves and makes up the shape of the amoeba (solid). These nodes are assigned random momenta so they start of moving in random directions.






If we just let the masses move off in their random directions decided in the previous step this wouldn't look like an amoeba at all. We now need to make the the amoeba undulate. We do this by simulating the physics which would happen if there were a spring between each node and a strong spring between each node and its corresponding exoskeleton point. This will keep all of the nodes close together so they are similar to the original circular shape, but allow them to undulate forming the basic outline of a moving amoeba.




Putting all of these steps together we get a very amoeba-like set of ~20 points, which undulates to varying degrees depending on the various constants we set. We are able to modify the spring constants, the masses of the nodes, and the number of nodes in order to experiment with various effects. Here is the result of our first few steps: