05/02/03: Progress Report #10

Plan

There are two things that I hope to accomplish during this iteration: the first goal is to code a function to recognize when an exhibit has been clicked and open a mplayer to show the exhibit.

The other thing is to add some more exhibits.  The plan is to have 3 more exhibits (videos and pictures) up in the museum.

Design

This iteration's code was surprisingly simple.  The mouse routine was already written from last year, so all I had to do was make the program recognize the exhibits.  What I did was modify the function void placeExhibits() to read in just the name of the file rather than the filepath.  That way when it's creating the matrix that contains the positions of all of the exhibits, it also can create an array that contains strings read in from the text file.

The way the mouse function works is when the user clicks the mouse , the program checks through the position matrix to see the distance from the user to every exhibit.  If the distance is less than a certain set value, the program opens the video file name given in the same element of the array containing the strings read in from the file.  As I said before, a fairly simple project.  I just made a string containing the system call I would use in an xterm window: "mplayer videos/filename.avi" and saved it as a string called exhibitCall.  Then, there's a function that takes in a string and inputs the command into the system, so there's just a line of my code that goes as follows: system(exhibitCall);

Coding

Download the code for this iteration: report10-museum.cpp

This iteration of the code requires textures and text files to run.  These files can be found here.

Testing

Although I only managed to add one exhibit, I did decide how I wanted to organize the technology section in order to add this one exhibit: the Wright brothers' flight.  You can see the new blueprints here.

I did, however, meet my main goal for this iteration--connecting the exhibits to their correct videos.  I don't have a way of proving this, but I definitely have been showing this to everybody who walks by, so I'm sure you've seen it.