prostheticknowledge:

Highway at Night

Javascript demo by Jani Ylikangas is an in-browser animated scene which is 1k in size (the code above is the actual program):

My initial idea was to do a very realistic looking demo of a car driving along a highway on a dark night. I watched some dashcam videos on YouTube and realized that what we see in real life is very limited – it’s mainly just lights and silhouettes. I made notes on what I saw and how I could try and implement it. But first I needed a good yet small engine for road construction and rendering.

I wanted the demo to have true perpective 3D drawing combined with cheap tricks. I found out that I only needed to do the center line with real polygons … the initial idea of photorealistic graphics was dropped in favor of vintage video game looks. Another thing that helps to fool the eye is high speed. This allowed the graphics to be very simple and raw …

You can see the animation in your browser here

Some backround information about how it was put together (including the source code) can be found at Jani’s site here