Code Editor with Webcam

Simon has come up with a code (in Processing) for an editor that includes live Webcam image to help him record coding tutorials. The project is still in progress.

Advertisements

Cannon Game in Processing

Simon shows the Cannon game he created in Processing (Java). He says he was inspired by the Stackoverflow forum, where he saw an example of the game and later wrote the code for a similar game himself. I saw him quickly write the code in a matter of perhaps two hours. Simon will post his code on GitHub once he has added a couple extra features.

Processing on RaspberryPi

Simon installed Processing on his RaspberryPi recently (using the terminal, which looked terribly sophisticated and scary as on Linux you’re forced to do everything through the terminal) and started preparing examples that he hoped to show during his own livestreams, but the RaspberryPi seems to have crashed, unable to bear the weight of so many examples…

dsc_19091456268463.jpgdsc_1908267889140.jpg

Computer Vision Projects in Java (Processing)

Among other projects during the vacation were also computer vision projects: color sensor, color tracker, motion sensor and motion/ face detection in Java (in Processing), partially Simon’s own code:

 

 

 

Flocking System Painting with Pixels

Flocking painting Live Video 8 Aug 2017

This is one Simon’s most beautiful projects recently! Simon saw the idea to link the webcam image to the boids of a flocking system in a video by Daniel Shiffman, but the code featured in this project Simon wrote himself. The Flocking code is based on Daniel Shiffman’s example from his book The Nature of Code. (Flocking is a steering behavior that consists of separation, alignment and cohesion – which are also steering behaviors – combined).

Simon’s sis also posed for the camera:

Flocking painting Live Video 8 Aug 2017 2

Simon is also about to make a JavaScript version of this fun project, because JavaScript allows to host it easily online, so that everyone can play with it. With JavaScript, he may even be able to write it in an online editor, so there won’t even be a need to host it. Check in later for an update to this post!

UPDATE: Simon encountered a problem trying to translate his Flocking System Painting with Pixels into JavaScript: P5 runs much slower than Processing after Simon added steering behavior. He doesn’t know how to solve this. Simon’s JavaScript code is online at https://codepen.io/simontiger/pen/ZJKBbN?editors=0011

Sound Wave Maths in Processing

Simon has created animations visualizing sound waves (Triangle, Sawtooth, Square and Sine waves) in Processing (Java), using wave functions.

These are the functions he used for the Sawtooth, Square and Sine waves:

DSC_1131

DSC_1132

Not to confuse “sine” with “sgn” (sgn standing for sign):

DSC_1134

He was inspired by the logarithmic and power functions that he was studying during his math class yesterday. Simon was trying to draw both types of functions in Grapher on his laptop, but only succeeded for the power functions (because there were no subscript option for the logarithms).

Simon’s own little neural network

Connected Perceptrons in Processing 26 Jul 2017

This is one of Simon’s most enchanting and challenging projects so far: working on his own little AIs. As I’ve mentioned before, when it comes to discussing AI, Simon is both mesmerized and frightened.  He watches Daniel Shiffman’s neural networks tutorials twenty times in a row and practices his understanding of the mathematical concepts   underlying the code (linear regression and gradient descent) for hours. Last week, Simon built a perceptron of his own. It was based on Daniel Shiffman’s code, but Simon added his own colors and physics, and played around with the numbers and the bias. You can see Simon working on this project step by step in the six videos below.

His original plan was to build two neural networks that would be connected to each other and communicate, he has only built one perceptron so far.

 

 

 

 

 

 

Hero Game in Processing. Simon’s Own Code.

Hero Game 24 Jul 2017 High Score

Simon has created a great new game in Processing: The Hero Game! It is somewhat like the good old Mario, except that Simon has no idea what Mario is and came up with the concept himself. The game is based upon Circle-Rectangle Intersection, something that he was studying for the past several days. It was impressive to see how quickly he wrote the program for the game, I think it took him something like an hour, while waiting for dinner. The game has a hero (Simon), represented by the yellow circle, obstacles (from below and above) and money that the hero collects to get points. The game stops once the hero hits an obstacle. Simon is planning to add extra random obstacles and maybe also create a winning score threshold (around 50 or 65, he says). His own highest score so far has been 35.

Below are the making-of videos, step by step:

 

 

 

 

 

Update: Simon added trees!

Hero Game 24 Jul 2017 Tree 2