Sunday, May 2, 2010

Status Report 10, or How I Learned to Stop Worrying and Love CV

As of tonight, everything works. Sometimes temperamentally, but I'm 99.9% sure that's the result of imperfect lighting conditions and miscellaneous camera quirks. I'm happy with it, at any rate. I may go back and tweak more later if I feel like it.

A Summary of my Time Spent with the Mitosis Game

I started this game in an attempt to teach children about mitosis in a new way that was more interesting than textbook learning. However, in the process I ended up teaching myself a lot about using other people's code, and using Flash in general. Some of the high points:

- Learning how to use the iHart system. This was obviously the major point of this exercise.
- Learning to code and implement my own events and event dispatchers.
- Implementing the refShot() function.
- Untangling all the iHart code to code my own pseudoserver.

The low points, of course, occured in the process of convincing all this to work; however, I think I've learned that with persistence and planning, things will eventually work out the way you want them to. It's been fun, guys.

Wednesday, April 28, 2010

Sunday, April 25, 2010

Status Report 9

ALL STAGES ARE CURRENTLY FUNCTIONAL WITH THE PSUEDOSERVER!!!!!!!!

Well, that's a relief. Also resolved is one issue in which two DNA bases would sometimes snap to their final positions at once--this occured when two bases whose final positions were adjacent appeared one after the other. To fix this, I moved the bases further apart vertically and changed the hit area so that only the nucleotide itself (not the sugar/phosphate backbone) counts as a "hit." Unfortunately this adds the problem of me not being tall enough to reach the top bases, but assuming we can run this thing from a ceiling-mounted projector that shouldn't be a problem in the long run.

Next week: camera debugging. I do hope we have tall enough chairs.

Sunday, April 18, 2010

Status Report 8

I got the reference shot method to work. Turns out the problem was that Flash takes a few seconds to send the data to the camera, so the new frame doesn't actually appear on the screen until after the refShot() method is called. If I set a slight delay between calling the method and actually taking the shot, it works. I'll be experimenting in my spare time to figure out exactly how long it usually takes and how long I should set the delay for.

In other news, everything up to and including metaphase works fine with the psuedoserver, so I'm very happy about that. Another problem that has cropped up lately is that if I enlarge the window to run it on the projector, the positions of certain objects get really messed-up. I think I can get around this by hardcoding the coordinates, but there's probably a better option I haven't thought of yet.

Monday, April 12, 2010

Status Report 7.1 - Eureka!

I have found a solution to one of my reference shot problems. The problem was that Flash's XMLServer, when its send() method is called, adds a zero bit to the end of whatever was sent, which was messing up the String.equals() method in Java. Short of rewriting Flash's XMLServer code, I discovered that if I use the String.startsWith() method instead of the equals() method, it works fine. Success!

The new problem is that since the server is not lightning-fast, the reference shot that gets sent is a shot of the screen a few seconds before the method call. This is problematic since the only time the method gets called is during a frame change. I guess I could program the Flash side to wait a few seconds before asking for a reference shot, but I'm going to speak to Audrey in a few minutes to see what she thinks.

Sunday, April 11, 2010

Status Report 7

Still on track, as the G1, S and G2 phases are now done. I am very happy about this. What I am not so happy about is my inability to write a function that triggers the server to take a new reference shot upon a method call to the CVManager. Basically what's happening is that the psuedoserver gets the message and responds (by printing out a specific string), but the general server acts like it hasn't gotten the message. I do not know why this is, but I will continue to plug away at it as I proceed with the rest of my project.

Monday, April 5, 2010

Status Report 5/6

So apparently Status Report 5 didn't actually go through when I hit publish. Oops. In lieu of typing everything again I'll just summarize what Status Report 5 actually said: all the graphics are done and I'm starting on coding now. Yay!

Now for Status Report 6: The G1, S and G2 phases are now totally functional. In addition, I have coded a custom event handler (I'm very proud of myself) to get the game to progress on its own. Unfortunately this also means I can't run it on the projector until I have a convenient way of taking new reference shots. For right now I'm just elated that it works at all.