The processes involved when I make stuff: sculpting, programming, electronics, carving, moulding, etc. Mostly puppets, automata, sculpture, occasionally furniture, interactives, food, etc. Usually fairly detailed and image-led. Please reuse any ideas, tips, thoughts and approaches.
Wednesday, 15 August 2012
Remote-control eyeballs: Using remote data from a published Google spreadsheet to position eyes with Processing
Above is shown a simple keyboard controlled Processing sketch in action. The arrow keys are used to position the way the eyes look. Each arrow key increases the value of a position variable for the irises and separately for the pupils of the eyes.
To remote control Twitr_janus' eyeballs, this was extended to send position data in 2 directions based on the values in a published google spreadsheet. The RSS feed is read and parsed by Processing to extract the data, which is used to compare the current horizontal and vertical positions with the target positions received. Processing runs a detection function that detects any difference, and reduces the difference by incrementally adjusting the current position and redrawing the eyes, until it can't detect a difference. A classic cybernetic negative feedback system!
Left published Google spreadsheet. Right, same with eyes.
Initially, so attempts at this went a bit haywire, due to over thinking the script to work out boundaries to stop the irises and pupils doing strange things (left) or leaving the edge of the eyes (right).
This java applet demonstrates the direct keyboard sketch in action. This is freely available to download and copy at http://openprocessing.org/sketch/67233
It requires Java, so won't work on some devices, but if you have a Java plug-in, you can make the eyeballs move with the keyboard arrow keys...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment