Monday, February 9, 2009

Building the Photosynthesis Engine IV: Nitty Gritty TIme in the Lab

Finally got a beta version of my light reaction light model to work properly. There were of course some programming issues. Since the model has moving parts, the parts had to be able to tell where they are in relation to other parts, get and send messages to other parts and that takes no small amount of coordination.

Not only that, when I moved the model to another spot, that created a problem since I tried an end run around some issues by using object keys. Well as I was afraid, keys are useless once the model is rezzed , since Second Life generates a new key every time an object as rezzed.

So here is what I did. I set up those parts that need to know where other things are to detect those parts using a sensor event as partly shown here:

The llSensor statement tells the object (in this case a proton) to scan a 10 meter radius for what ever objects are around and then the if statements within the sensor event enable the proton to "tell" Of course real protons move randomly but in Second Life having lots of randomly moving protons presents some this is a compromise.

Also I could have done the protons as particles, but you can't control where particles go and since they are generated client side, can't interact with the model.

There are always design compromises in modeling and that is true in Second Life as well as in other modeling systems and the modeler has to pick the right compromises for the level of modeling being used for the audience.

The Calvin cycle will be much easier...far fewer moving parts and coordination problems especially since I have dealt with some of the issues involved in the Calvin cycle in Photosynthesis Engine I and II.

If you have Second Life installed you can visit the light reaction model in its temporary home at:

On tap this week:

  • Calvin cycle.
  • Look at Max Chatnoir's pedigree program. Max has graciously sent me a copy to study.
  • Faculty meeting - in person no less...that's so 20th century.
  • Also in the middle of Angel training.
  • Friday I am going to be at the Stepping to Science workshop. I was supposed to go to the first iteration of the workshop but my registration got messed up.
  • Oh yes one more thing: change the cats' litter boxes. Now that really is so 20th century.


john said...

This is ambitious. I'll be watching with great interest. Nice work on it already, too.

From the LSL Wiki: "The sensor() event handler will receive a maximum of 16 detected objects"
There are more than 16 objects in the model; could affect outcome if model grows in prim number.

Question: What are the primary learning objectives for the design?

julie said...

WOW! What a great way to teach these concepts in a virtual environment!! I will be sure to share this with Steve Spangler (who is working on a Second Life project) and suggest that he blog about your Photosynthesis Engine at

Simone said...


I have a tendency to start in the middle of something on a project so learning objectives what are those?..just kidding.

As for the learning objectives I want the user to be able to:

1. Give the function of the photosystems in the light reactions
2. Explain the source of oxygen produced by photosynthesis
3. Explain the role of electron transport in the light reactions
4. Explain the point of the light reaction (Make ATP and NADPH)
5. Explain the relationship between the light reaction and the Calvin cycle.

They are not all clear from playing with the model yet since it is only partly implemented...

My bigger vision is to get the user to get the student to engage with biology as a set of processes that interact with each other rather than a set of facts.

So I want the user to interact with the model without much more than very general guidance as to what the learning objectives might really be. After all the universe doesn't come with a set of learning objectives.