Monday, November 3, 2008

When Pong Meets OSC

3 November 2008

Monday blues! Got to work early and had breakfast there while reading up on YouTube in Wikipedia. Then started to work on the '4 Player Pong' game. Soon after, Ming Hong came in and told us that Kevin and him had to attend a seminar and won't be around till Wednesday. So there won't be any progress report or disscussion till Wednesday, which means more time to do enhancement to our application before trying to integrate it with Lightdraw.

Had lunch at Crystal Jade today. Most expensive lunch so far during the internship. I guess it should be fine to have lunch at such a place once in a while as we just received our first paycheck.

Headed back to Fusionopolis to continue with our work while Kevin and Ming Hong went to attend their seminar. We did not have much progress because I struggled with understanding the Mathematics calculation for the speed and angle of the ball. However, I manged to fix the bug with the help of Ming Hong during his tea-break. Took a short break and went to the pantry. Here's a few pictures of what our pantry looks like and the view from it:



By the end of the day, the bugs for the ball is fixed and I have also managed increase the speed of the ball after a certain number of hits. Ryan also managed to make the yellow paddle work with the mouse, which is great news. Tomorrow will be the integration with Ryan's part and more enhancement to our '4 Player Pong'.


4 November 2008

Kevin and Ming Hong are busy as they had to attend a course and seminar respectively. So we were left on our own for almost the entire day.

Managed to reflect the ball back to the previous paddle after a number of hits was done in less than 15mins after I reached the 'working space'. Waited for the rest to arrive before I tried to integrate with Ryan's part. As there were some changes and modifying of the codes to be done, we were only able to finish integrating it after lunch.

Took a short break after the integration. During the break, a friend of mine started asking me questions about Linux in aMSN. So I did some research regarding the questions and found this really good website for on Linux. Here's the link for it.

Went back to doing our application and tried to integrate sound into the game using the irrKlang library. By the end of the day, we managed to add the sound in. However, there was like a 2-3 seconds delay when the sound was supposed to be played. I guess we will just ask Kevin for his suggestion when we meet him tomorrow.


5 November 2008

Tried to do the winning message before Kevin came in, but was unsuccessful. So we showed him our progress and what we intend to do. We had also asked him about the sound thing, but he said focus on the OSC and get it working with Lightdraw first. Completed displaying the winning message before lunch. After we finished our parts, we played with the 'Drawing Board' done by Ming Hong. So this is what we drew:


It's the first time we interns had lunch by ourselves. For the past 2 weeks, we joined Kevin, Ming Hong, Harold and Bernard for lunch. However, they had to attend a farewell lunch at Harrys. So You Hock, Leonard and I went to lunch at the Dover Hawker Center nearby. Ryan did not join us as he felt unwell. We had chicken rice there as it was recommended by Bernard. We shared half a chicken and had a plate of vegetables, and we paid like only $4 each! Plus, we had free servings of rice and it tasted good.

Bought congee for Ryan and we got caught in the rain. Ran all the way back to Fusionopolis. Passed Ryan his congee and went to dry ourselves. Rested for a little and we went back to doing our applications. Managed to edit the OSC makefile with the help of You Hock. We had also made some changes to our source codes, with the help of Ming Hong, as some codes did not run on the Mac. In the process of changing some codes, I've learnt that by adding in a few lines of codes, we could make the compiler choose which lines of code to compile in both Mac and Linux.

By the end of the day, we had discovered that our application wasn't running with OSC. I hope that we will be able to integrate our application with the OSC smoothly.


6 November 2008

Tested our application with the OSC when I got to the office. To run the application in OSC, we first have to start Lightdraw. It did not run as smoothly as expected. So we had to modify the codes for our application. Time passes quickly whenever we concentrate on a task. Before Ryan and I know it, it was lunch time.

Went to have lunch with Kevin and the rest at Holland Village. During lunch, we were discussing on social and environmental issues. It was pretty interesting to listen on other people's views on such issue.

Created a C++ class after lunch to store the coordinates of a laser with the help of this website. I also managed to set the starting position of our application to the top left corner as Lightdraw takes in the coordinates of the screen instead of our application. This was done after a quick Google search, and here's the link for the site.

After we told Ming Hong our progress, he suggested for us to use an array of cvPoints instead of the trouble of using a single class. So we changed the codes and commented out the class I created. By the end of the day, our paddle was only able to move upwards. I guess it's all part of my wishful thinking that the integration of our application with the OSC could be done in a day. Hopefully, we would be able to integrate our application and the OSC by tomorrow.


7 November 2008

Reached the 'working space' early today. However, I was feeling rather unwell and rested till the rest arrived. When the rest arrived, we began to work on our applications. Ryan and I tried debugging and realized that we are unable to print out anything when we used the 'cout' function. So we used the 'printf' function and we were able to debug it finally. I've also found out that the 'printf' function could do formatting while the 'cout' function could not. Here's an example on how to format using the 'printf' function:

printf("Here is a number %d and a %s word.\n", number, pointer);

%d %s are the printf format identifiers

Here's a link on the other available printf format identifiers.

After testing and modifying the codes, Ming Hong suggest that we slow down the speed of the application because the our application speed might be faster than what the OSC could receive. So we tried slowing it down and we managed to make the yellow paddle moved.

We then help Ming Hong to clear the projector room to make way for our new projector. While the people where bringing in the new projector, we continued working on our application and did the checking for the collisions between the yellow paddles and the others. After finishing the collisions check, we tried running it on Linux. However, the application did not go well because the screen positioning of our application was different. Kevin suggested that we take a break and had our lunch at VivoCity.

After lunch, the installation of the new projector was done. Here's the pictures of our old and new projector:

Old Projector

New Projector


We waited for Ming Hong to change the settings of the new projector before we tested our application on it. And by the end of the day, we managed to make the other paddles move and checked the paddles collisions with just a single laser. So it wasn't wishful thinking after all.

So by next week, we would be able allow our application to support multi-lasers and invite Mr Yeak over to show him our progress.


Reflection for the week:

This week had been a very productive week for me as I had learnt alot about C++, OpenCV and even the C++ compiler. I'm getting pretty used to typing the codes in the text editor. It feels just like when I was in my first year in polytechnic when we used to do write an application, and only finding out that we forgot to add a semi-colon or close a bracket during compilation. I guess I have been spoiled by the IDEs these days as they would prompt what are the methods/functions available after we entered a '.' and just choose from the list.

I have also been more adapted to travelling from east to west. Spending my time during the journey to keep myself updated with local and world news. After spending so much time with Kevin and our collegues, I found out that by keeping myself updated with the news(this week is about Obama, of course), it is easier for us to find a topic to talk about.

On a side note, I think I would install Linux on my laptop in the future for development purpose.

No comments: