Thursday, June 4, 2009

Particle fun

In building my protein synthesis model, I really don't want to use more prims than needed. At the same time I want to display the results in a more interesting way than than as a string. So I have been playing with a particle system.

Here's the result. The script is modified from a snippit of script that generates a particle banner by Debbie Trilling, part of her Random AV profile script.

I tweaked those settings to give two functions that collectively take a text string and converts it into a string of particles. One could use this to display text messages, but here I am using it to display the one letter amino codes of a proteins primary structure. The colors represent the type of amino acid (non polar, acidic, polar non ionizing etc). Of course you have to put a texture for each symbol.

The two functions I developed to represent the protein's primary structure as a string of particles

particleletter(string texture, float distance, float size)

particlemessage(string message, float distance, float size, float speed)

This system unfortunately does not work reliably in that the individual particles are not always produced so the display will have gaps in it. This is a big problem with long polypeptides such as this one here which is the primary structure of an opsin protein.

Another limitation is that the particles only last for a minute or so.

For the student version I will use a small polypeptide with 10-12 residues, that way the DNA template and RNA will require only 30 or so DNA bases. That is a lot more practical.