Tuesday, May 24, 2016

Jelly Ball

One thing I enjoy when programming is to make weird interactive computer-generated objects. In this post, I'm showing you... a blob. To see the blob, simply click on the black box. The blob will immediately appear. Once you have the blob, you can drag it around with your mouse - just press down and move it around. When you let go, the blob will snap back with a little jiggle.

Click here!

There are a few things I'd like to point out about the blob:

First, when you stretch it, it actually gets narrower. When I designed this, I wanted it to shrink enough to look realistic, but not far enough that it looked weird.

Second, notice that it drags faster depending on how far you stretch it. The speed at which it drags is proportional to the square of the distance stretched. I found that this was much more realistic than making it directly proportional to the stretch. Also, if you only stretch it slightly, it doesn't drag at all (this simulates static friction).

Finally, there's gravity. The gravity isn't strong enough to drag the blob, but it is strong enough to stretch it slightly. When you first create the blob, it bounces slightly as a result of the gravity.

The graphics was probably one of the most interesting parts of writing this program. First I included my Firetools.js library for some simple graphics functions. Then I simply stacked a series of filled translucent circles. I placed the circles on a straight path from the base to the tip of the blob, and determined the size and color using some simple math.

One of the biggest challenges I faced in designing this blob was setting it up to move around the page. It took a long time to figure out how to disable the highlighting of text and the clicking of links below the blob. (For geeks who are interested in my solution, it involved disabling pointer events on the canvas, and using an event listener in the window to turn them back on whenever the mouse was over the blob.)

Overall, I'm really happy with my final result. I hope you enjoy it!

New posts every month - subscribe for free!

Friday, May 20, 2016

Boeing 747 Drawings

I am fascinated by man-made transportation devices. Besides the fact that they can be very advanced technologically, they almost always look really awesome. The ones that fly are the coolest to look at; I love their sleek appearance and clean, smooth colors. It makes them really fun to draw.

In this post, I'm including a two different drawings of a Boeing 747.

One interesting thing about the Boeing 747 is that there isn't only one type. The 747 comes in several variants, each with different dimensions and characteristics. The 747SP is the shortest of the variants, with a length of 185 feet; the longest is the 747-8, with a length of 250 feet. I decided to draw the 747-400, which is 231 feet long.

The first drawing is a sketch I made using a regular graphite pencil. To prepare for my watercolor sketch on special paper, I thought I should make a quick practice sketch first. Once I started sketching I decided to go the whole way and make it good, so my final result actually ended up being somewhat realistic.

Next I used watercolor pencils. This is the first detailed drawing I made using watercolor pencils. It was a neat experience. Watercolor pencils are basically like regular colored pencils, but the pencil lead is water-soluble so the drawings can be smoothed out with water and a paintbrush. The pencil tip can also be moistened, making it like a tiny paintbrush capable of rendering fine details.

New posts every month - subscribe for free!

Monday, May 2, 2016

Black Holes

On February 11, scientists at the Laser Interferometer Gravitational-Wave Observatory announced that they had detected gravitational waves from one of the most powerful events in the universe: the collision of two black holes. In light of this event, I thought I'd post a basic overview of black holes.

Black holes exist in that fuzzy realm on the border between theory and fact. A surprising amount of information regarding these mysterious objects has been determined through mathematical proof, and yet there are still dozens of questions to answer and apparent contradictions to explain. We don't completely understand how they work, but we know they exist.

Because of its strange nature, the idea of the black hole plays a large role in the average person's concept of the universe. Everybody knows about black holes. The problem is, most people don't understand what a black hole is. Some people imagine black whirlpools sucking everything in. Other people imagine powerful vacuum cleaners, from which nothing can escape. The truth is a little different.