The following are experimental depictions of protein folding. They require a pair of cheesy 3D glasses [left eye red, right eye bluegreen] and a browser that correctly implements the Java virtual machine. The former are relatively easy to come by; the latter, of course, does not exist.



Helix fragment [3.2 mB]

Neurotoxin [11.2 mB]

...



Notes and caveats:



Other business having occupied me for a week or two, it took a while to get back to this, but now it seems to work, with the following caveats:

Assuming that this would end up on a Mac one way or another, I simply compressed the folder with the very useful but perhaps not absolutely universal Stuffit Expander. It should unpack into some class files, a source file, a couple of html files, and some miscellaneous shit CodeWarrior seemed to think was important but otherwise irrelevant. -- If it doesn't run as an applet right out of the box, presumably it can be recompiled. If not, it's one more entry in that six-volume treatise on "The Myth of Portability" we've been amassing over the years.

The fine print on applets vis a vis standalone applications in Java is that the former are not permitted to read data files on the client, though they can on the server; without tweaking some permissions file that wouldn't be portable and which I can't find anyway, I can't convince the code that my own machine is the latter not the former, and, accordingly, settled on the curious but [barely] workable device of putting all the data in the html file. So there are two of them, one small, one large; the one the applet reads is the one labelled "stereo.html", and, accordingly, to switch demos from one to the other you have to quit the program and swap their names around. [You don't have to recompile, however.] The small one is a helical fragment; the larger one is a neurotoxin. What exactly they're doing is a somewhat longer story, but even this much of it looks fairly cool, so we'll let them speak for themselves.

The theory of making the player an applet is that thereby it becomes displayable in a browser, but this is, of course, mainly wishful thinking. No two browsers execute Java code identically, and usually only one [Opera] gets it right.

I have only one copy of Netscape left, and though it will open the smaller file and execute it, there doesn't seem to be any way of setting the background color to white within the applet window, meaning that the stereo effect doesn't work. So this sucks.

OmniWeb and Internet Explorer will run the applet, but neither seems to be able to load the larger html file. So no neurotoxin here.

Opera runs everything correctly, but pulls a muscle, or something, while doing it, and won't run Javascript correctly afterward until it's restarted. Otherwise [as usual] it's the best. [Why are Scandinavian hackers the kings of rock and roll?]

The Applet runner that comes with the Mac OS X does run everything correctly and the window looks better, so this is probably the best choice.

There might be a color portability issue [though, red and bluegreen, what could be simpler], but it seemed like too much trouble to put a color wheel into it along with everything else. So I didn't. Yet.

The buttons look right, more or less, but the other half of the idea was that the cursor should also float above the screen. Unfortunately though it turns out that you _can_ [contrary to my previous impression] access the cursor definitions in an applet, at least if you open another window [a Frame object, as if you gave a shit] and draw in that instead, you can't write your own cursor definition; another Macintosh idea they forgot to implement. [In general they don't seem to have control definitions or the idea of passing a set of drawing instructions as an argument to e.g. a window definition. -- No wonder Sun is going broke; at least Microsoft managed to steal everything.]

The controls mainly work, though there aren't really enough of them.

The zoom in/zoom out, e.g., is the true camera zoom, i.e. simple magnification, which should be distinguished from track in/track out [moving the pov along the z-axis, not implemented], which changes perspective.

The angle buttons only torque one way. I don't like the convention of using the option key [or whatever] as a modifier, but I haven't any better way to do it for the moment, so I left reverse out.

Unless by some chance you have the Symbol font installed, the angle buttons won't display the theta/phi/psi labels. [Not the "real" Euler angles, of course, but rotations in the xy, yz, and zx planes respectively.]

I didn't implement translations in the xy-plane. The helix leaves an initial segment fixed; the neurotoxin leaves its barycenter fixed [on the strong axis x = 610 in a window which is 987 by 610 for the usual numerological reasons.] The latter convention is more pleasing to the eye.

I wrote a couple of sliders to serve as progress bars, but they looked stupid and so I left those out too.

The code is shit, but since the net result of writing in Java is automatic access [in OS X] to the graphics engine, I'm pleased with the results: it runs fairly fast as is, acceleration should be automatic, the hated jaggies disappear, etc. Compared with the only other "official" choice they offer you [Objective C] it almost makes sense. I'll try another draft presently. Meanwhile, let me know if you can get this to work.


Later.




..........
“...veil of space with coloured emblems on its field. Hold hard. Coloured on a flat: yes, that's right. Flat I see, then think distance, near, far, flat I see, east, back. Ah, see now. Falls back suddenly, frozen in stereoscope. Click does the trick.”

[Joyce: Ulysses: ]