Our library `gwoptics' for creating mathematical/scientific plots of 2D or 3D data has been updated to be fully compatible with Processing 2.0. The latest version (0.5) can be installed via the library manager tool inside Processing, or you can get it from our webpage:
http://www.gwoptics.org/processing/gwoptics_p5lib/
I have just created a very simple Android version of my `Bouncing Ball' sketch: a little ball bounces around your phone's screen, move it with your finger or by moving your phone.
This is a trivial example of course, based on information from the Wiki and this forum. However, seeing the complete code of such an example might help the absolute beginner (i.e. someone like me).
I have been playing a bit with the Javascript mode of Processing 2.0a4. It seems that the directional lights are working with spheres (as shown in the online examples) but do not work with beginShape(QUAD_STRIPS) (works fine in standard mode but not in the Javascript export). See for example, a slightly changed version of the Toroid example:
I am wondering in which direction I should develop some of my OPENGL sketches.
I had started to use the GLGraphics library in some sketches because I notices that using the texture commands of the library was much faster than using image related commands with the OPENGL renderer (I have not managed to try the OPENGL2 renderer yet).
What will happen to GLGraphics? Will it be co-existing to the new OPENGL renderer in Processing 2.0? This is related of course to the question of what new features the new OPENGL renderer has.
Design your own gravitational wave detector and see whether you can beat the experts!
Space Time Quest is a manager-simulation type game. The player can use a limited budget to design a gravitational wave detector. The goal is to maximise the sensitivity by adjusting several subsystem parameters correctly. This game has been developed as part of our outreach programme in Birmingham; our aim was to create a fun game that is easy to play, looks good and gives some insight into the complexity of gravitational wave detectors.
This has been by far our largest Processing project yet. We make use of the core libraries as well as the G4P and gwoptics libraries but the code for the game engine has been written from scratch by Daniel Brown (who's also the main guy behind the gwoptics plotting library).
The source code will by available under GPL2 (just packaging and cleaning it right now). In the meantime you can download and play the game here:
Ok, this one is a bit more scientific than usual. Do you know the sound of a gravitational wave? Listen to this!
Inspiral Signal (or Chirp Music) show the orbits of colliding black holes and play the characteristic `Chirp' sound of the gravitational waves created by such an event.
Another sketch for science exhibitions: A virtual pendulum follows your hand (holding a marker) just like a real pendulum would. We use it to demonstrate how a pendulum can be employed to reduce vibrations; but it is also simple fun.
It's a basic implementation of the nyARToolkit. More info, the code and a nice video can be found at:
It's been a very simple process of uploading some info and images for the logo and screen shots, I simply followed the
tutorial.
Since the game is a Processing application for download the store just links to the download page. I.e. when the user clicks on `install' in the web store (in a Chrome browser only at the moment) the browser redirects to the original download page. Effectively the store entry is an advert for the game's web page. And, yes, I paid $5 for the privilege (it's a one time fee though, not per upload).
Comments about the Chrome web store are mixed and it's a serious drawback that it works fully only with the Chrome browser. Still, so far I think this could be a nice (professionally looking) way of advertising Processing applications or applets which might actually be of use or interest to someone outside the Processing community but are currently hidden on a low-traffic web page.
For example, most of the Processing applets and applications I have been involved with are meant for outreach, bringing a particular science topic to the people. They work well in exhibitions and I believe they would also do their job online - if the right audience knew about them. Thus the idea to use the Chrome web store. I thought I'd share my experiment here and I shall follow this up with more info later.
Anyone else with the same problem? Or maybe even with a better solution?
`You are Einstein', a virtual mirror which gives you and your friends the Einstein look.
This Processing sketch creates a virtual mirror with the computer screen and a web camera. A face detection algorithm is used to replace all frontal faces with a picture of Einstein. The image below shows a screenshot of the program in action.
This is a very simple use of the OpenCV face detection and the code is largely based on examples found in the forum. However, I wanted to post it here because it combines a few things that might be helpful for beginners who like to learn by messing with existing code. The main features are:
- it runs fast by having the face detection in a separate thread (so that the video display is not slowed down)
- pressing space takes a snapshot and saves it, the filename containing date and time
Since the topic of games and Processing came up twice in recent posts, I thought it's a good time to announce a new Processing game: Black Hole Pong
The game is a remake of the old classic Pong but with an astrophysics flavour. Instead of controlling a `panel' to bounce a `ball' to and fro, each player moves around a black hole and has to make use of its attractive gravitational force to keep throwing a star towards the other player.
The only realistic part in this game is the mathematical form of the gravitational potential of the black holes. The rest is pure fantasy. However, I think this illustrates the effects of gravity on the stellar scale quite well; and one can get an idea of how space craft use flybys to accelerate too.
We have used the game very successfully as a fun element in an exhibition and that's where it works best: it can only be played by two players (i.e. you cannot play against the computer), has only one 'level' and the control is best with two Xbox controllers (connected via USB). However, it's good for a bit of fun at home as well, using two mice (on a Mac) or even the keyboard to control the black holes.
As my first try to use Processing.js I have made an interactive and animated webpage banner. I might use it for the webpage of a science exhibtion later this year:
It runs slower than I had hoped. In fact only Safari seems to be able to run this at sufficient speed, Chrome does an OK job and it stutters along in Firefox (I have not tried Opera and it switches to a static image for IE). But overall I am very excited about Processing,js!
All the recent effort by the Processing guys on their webpages urged me to finally add the source code to our online applets at
http://www.gwoptics.org/processing/
Some of you might have seen these sketches before. They are all related to optics and interferometry. Now they come
with the full source code for download. The type and quality of the code is very different since every sketch has been
programmed by a different student; so most of the code is really not useful as an example. The code for the GBViewer
is pretty good though and makes a nice example for plotting functions in 3D, I think. And the Michelson example might work as a simple template for embedding a display in larger frame with GUI elements.