Giter Club home page Giter Club logo

matrix-rain's Introduction

Matrix rain

This experiment recreates the opening scene from the movie The Matrix and takes inspiration from the Matrix digital rain wiki. Animation done in P5.js and GUI in React.

Demo

Codepen demo

Development build

To build it locally, run

npm i
npm start

then open http://localhost:3000/ in the browser.

Note: There are performance issues in dev build because of the unminified p5 lib. This can be alleviated by using the minified version at the cost of less meaningful debugging messages. See P5Wrapper.js

Production build

npm i
npm run build
npm run serve

then navigate to the link provided.

Evolution

This experiment began after completing the Natural Simulations in Processing course on Khan Academy. Originally I used the in-browser editor but I wanted to use ES6 so I moved onto codepen. See attempt 1

At this time I discovered P5.js, a modernised version of Processing.js built for the web and I decided to port over to it. It comes with numerous libraries, one of which is the P5 DOM library that lets your sketches interact with DOM elements. Sounded useful as I have a GUI that I wanted to bring outside actually rendering the animation.

The P5 DOM library is still in early experimental stages and unfortunately, I found it quite clunky to use. Creating elements is akin to the DOM API. Yuck. See attempt 2

Finally I looked into using React to render the GUI and found React-p5-wrapper, a component that lets you pass props to sketches. See attempt 3

As a free user, one of the annoying things with codepen projects is the 10 file limit, so I had to cram a whole bunch of classes in there which is why this repo exists. The sketch classes have beene moved into separate files and each React component has its own css file.

matrix-rain's People

Contributors

timiscoding avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

matrix-rain's Issues

Slow FPS on the version in this repo

Hello @timiscoding,

I have noticed an important FPS drop (4 FPS with 82 raindrops) within the first seconds of the animation with this version in the repo although the performance is quite good with the version on codepen.
I don't know what's going on there...
The best perf seems to be reached in your attempt 2.

An idea?
Thanks! :)

Licence?

Hello @timiscoding!

Thank you very much for the wonderful work here, I do love very much your work and I'd like to use your code as a base for a personal project (some kind of artwork of my resume).
Of course, obviously, if you agree on letting me use it I'm gonna mention your work.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.