Esfera mod by spxl 3 17 November, 2008 at 1:05 pm
Esfera_mod_by_spxl_3
based on Esfera.pde by David PenaSource code:
Esfera_mod_by_spxl_3.pde
Hair.pde
Oscillator.pde
I decided to have a bit more of a play with Processing. Some of the changes in v3:
- Hair.pde and Osciallator.pde created with just the Hair and Oscillator classes in them. I also removed references from the Hair class to the global variables used as parameters for the random values; there are now constructors that take parameters, and the random values are now calculated in the main program.
- There are now some keyboard controls:
- [up] and [down] arrow keys increase/decrease the oscillation speed of the base level of the hairs (the outer sphere);
- [z] pause/unpause inner sphere oscillation;
- [x] pause/unpause outer sphere oscillation;
- [c] pause/unpause hair count oscillation.
- Some 3D text added – Hello! :o)
- Snaking tentacles (made out fo a series of boxes). There are three new oscialltors to control the tentacles, two different rotations, and one for the scale factor for each successive box on a tentacle. Certainly nothing new in the computer graphics world, but a first sample from me.
It certainly seems that the OpenGL rendering is far from perfect. For instance, it seems sometimes that the text is transparent (eg bottom left “Hello” in the screenshot), and other times not (eg the right “ello” in the screenshot where you can just see a box around the “o”). Maybe a bit hard to spot in this screenshot, but pretty obvious when the program is running. I have no idea at this point what causes this (and other strange display artefacts), nor how to address it. I don’t know if it is an OpenGL thing, or something to do with the way my graphics card renders it.
What I do know is that when I replaced the box() calls for the tentacles with sphere() calls, it slowed down rather dramatically and looked a bit naff to boot. I think I miht have to drop the fantasy of seeing something coming out like a nice raytraced scene!
-spxl
Leave a Reply