This week, I programmed a scene of moon eclipse based on functions inside objects.

URL:    http://sabrinaaa.com/visual_language/moon2/

I created an variable object named “shadow”, and inserted three functions in it:

display: function(){

// Create an ellipse



// Let the ellipse move



// make the text change by the change of shadow



The most difficult part of this project for me is to make the shadow into dark red color, because the creation of this project is like the layers in Adobe photoshop. If I change the color into red, people will see an bigger ellipse passing through the canvas to give the moon a red mask. My goal is to give the move a red shadow, which cannot be seen on other part of canvas. I tried many times to use functions inside the “shadow” to color the moving shadow in red, but I did not find a way to order the layers properly. So I created a very big black circle, with “noFill” but many “strokeWeight”, and two black “rect” to cover the trace of the red shadow ellipse. The order of layers from back to front is: background, moon.png, red shadow ellipse, mask(rect and big black noFill circle), text”MO_N”(actually a typo png made in AI), mask to change “MO_N”.

Below is some screenshots of my project “Moon”, and URL of the project is on the top of this blog.

2FC1C75E-A24C-4410-B282-8C9E10C6749D 2C384CEB-88E1-460A-B9A8-0D317C68BCC6

CD6DFE09-D506-4E9C-A01F-DD1C87A00C99 91B0D007-2C8D-46FE-BF0B-E1401272AD5E


Leave a Reply