Friday, February 20, 2009

Week 18

16 Feb
I continued working on the multi-user function for the 3D visualisation application for the whole day. Trying to figure out what could be the problem that caused the models unable to load but still no answer to it. At around 5pm, Ming Hong came over and told me to change the patches that stores values to persistent memory as the logic patch will execute again when it receives an input.

Just I was about to leave the lab and head to school, I realised that it was using the same variable name for nested loop. However due to a meeting in school, I can only change it tomorrow.

17 Feb
I changed the variable name the moment I reached the lab but the problem still persisted. I could not find the source to the problem, so I duplicated a copy of the application for single-user and started changing it again. The 2nd time, at least the menu was working and was able to load to the "model view" screen but it there is no models shown on the screen. 

During lunch, I told Ming Hong the problems that I have encountered and he suggested that I should set all persistent variables to "false" and only set to true when needed. 

After lunch, I tried what Ming Hong had suggested but there was still no models on the screen. I realised that I broke the connection from the image path. But when I tried to load the second model, the screen seemed to be flickering and I found that the status set were not persistent.

When almost reaching to the end of the day, I could only managed to load the models supported with multi-user. The next problem was with the functions, I could not seemed to trigger the functions even though Lightdraw did detected the lasers. The passing of the values seemed to be slowed after the 2nd model was loaded. Kevin told us to redo the whole 3D application and forget about the single user version.

18 Feb
Went back to school for ITPS briefing and PSRP presentation.

19 Feb
We present what we had presented yesterday to Kevin. Soon after, we went back to our work while Kevin and Ming Hong discuss on what to do with the 3D application. After discussion, Kevin decided that I would work with Ming Hong to make the multi-user work.

After lunch, Ming Hong went over to the lab and take a look at the composition that I have edited and told me that that was too much processing, he deleted most of the patch and started to work only on the menu and soon, the functions. "Divide and conquer" is what I would use to describe the way he worked. He also told me that the reason that the functions that I have edited could not be done because I have missed out variables that were supposed to be persistent but was not and because, it was loop in the iterator, the functions basically died on me as there was too much processing power required.

Soon, the moving and scaling function worked and before we left the lab for the day, we updated Kevin on our progress.

20 Feb
Today''s task was to complete the rotation function of the 3D application. It is the most complication function as compared to the rest as we could not simply use the model patch to do rotation. The model patch had a "track mouse" into that tracks the mouse movement when rotating. However, if we are using the OSC mode, the mouse movement remains static and the model could not rotate as it only tracks the movement of the mouse.

So what we did was to code the rotation using Euler angles. It was really complicated as there were unfamiliar formulas and equation. Thanks to the help from Ming Hong, we had managed to let the models rotating using lasers.

After that, we updated Kevin about the program had also learn the differences between a 32-bit computer and 64-bit computer from Kevin which makes me think back of the drawing problems found while we were trying to get a video shoot for LightBoard. It was then, I found out that it was because of the difference in the graphics card. The graphics card that the Mac Pro was using was more precise than the MacBook Pro as the Mac Pro was able to read values that was really small.

Reflection:
This week was a really busy week as we had to prepare the presentations for the PSRP and also had to complete the 3D application. Thankfully, our hard work had paid off. We had to thank Dr. Eng and Kevin for their guidance. I had learned how differences in hardware would affect the performance of an application. We had also learn that often we are too used to having rules,  we tend to stop being wise. But that does not mean that there should not be rules, we should have rules but we should be flexible with in according to the situation.

Thursday, February 19, 2009

Week 17

09 Feb
As suggested by Kevin, I am task to add/edit some other functions to make the whiteboard application more 'complete'. I started by adding a timer to disable the drawing function after a period of time. The reason for adding the timer was because the user may forget where he had last drawn on the screen and continue to draw inside the radius which he might not intended to causing unwanted line to be drawn. I was researching on ways I could add a timer into the Javascript patch instead of using the stopwatch as I though it would look even more complicated if I continue to add patches into the composition. I continued to find ways to do it until I realised that I could actually make use of the timer inside the 'idling' function.

After some testing, I continue to work on the "Clear All" function as Kevin does not want the canvas to be cleared only when toggling off. After editing the "toggle overlay" patch with some help from Wilson, the "Clear All" function is now at the bottom right of the canvas, similar to the one embedded in Lightdraw.

10 Feb
Today's task was to enable marker creation on light detection. It was fairly simple to do as the codes are similar to the one used for creating markers while pointing at the palate. However, after some testing, we found problems with the colours of the markers.

The default colour for the markers were set to be white whenever the marker was created on detection. However, when the user changes the colour of the marker, the colour of the marker created on detection remains the colour that was last changed.

With the help from Ming Hong, we decided to edit the "moving" patch to take in the colours of the marker to solve the problem. Soon after, the problem was solved and we creating an offset in the composition to make the markers looks more accurate when drawing and dragging.

I updated Kevin after that and had also restricted markers from creating and dragging at the toggling area and "clear all" area as the user might accidentally create a marker on hold while toggling on the whiteboard.

11 Feb
Soon after I reached the lab, I started testing on the whiteboard application ensuring that there was no other problems with it. After that Kevin came over to the lab to discuss with us on the things we are going to present to Mr Yeak tomorrow. Went over to help Wilson with the rotation problem on the 3D visualisation application.

After lunch, we practice on what we are going to present for tomorrow for the rest of the day.

12 Feb
We did a dry run on our presentation today in the morning. After that, we went on working on our task. After lunch, we cleaned up the lab and went through our task for the presentation. After that, we did another dry run before Mr Yeak arrived. Kevin started introducing Lightdraw and what we had been doing for the past few months. We showed him the 4 player pong, Puzzle game, the tiled display and the whiteboard application.

After the meeting with Mr Yeak, Kevin told me to add a delay to the creation of marker on light detection as user may create a marker by accident. I change the codes before I left the lab for the day.

13 Feb
The task for today was to integrate OSC with the 3D application and  do a videoshoot for the whiteboard application. Leonard and I will be in the videoshoot while Ryan and Wilson will be working on the slides. Just before lunch, I transfer the latest Lightdraw and the whiteboard application into the MacBook Pro and Kevin went on telling us the script for the videoshoot.

After lunch, we took the DV cam, the stand, the laptop and went for the videoshoot at Boltzmann room. As soon as we started to test the setup, we found problems with the whiteboard application. Lightdraw seems to be breaking too often and we are unable to draw. We spent hours trying to find out the problem. Kevin and Ming Hong came to our rescue too. All 5 of us was trying to figure out why the whiteboard application could not draw. Initially, we thought there was some patches missing or Lightdraw is not working well. But done of them seems to be the answer. We went back to the lab and test the application on the Mac Pro and it was working and so we tried launching on the MacBook Pro again and we conclude that it was the problem with the composition. With some help from Ming Hong, we manage to solve the problem. I did not know what was the problem behind it that caused the drawing to fail but it seems that it did draw but it was not visible. 

We rushed back to the room and start on our videoshoot and left the lab for the day.

Reflection:
This week, I learned about making decisions and having a mind of our own. In life, we have to make many decisions, whether it work or school, making decisions is what we could not avoid. It all depends on the mindset of a person, whether you have a mindset of a leader,  a follower or even both. 

We often have a problem of following decisions regardless it was right or wrong. Reason being that often when we were in school, we tend to be with our friends and follow what they do and when we realised that there was a problem, it was usually too late. 

It is important to have a mind of our own and that does not mean that we should not listen to other people's advice. Being able to know what is right and what is not will help us in making our own decision and often, wanting to know what is right and what is not takes time.

Monday, February 9, 2009

Week 16

02 Feb
While Ryan and Leonard are busy doing the 3D loader application on the other side of the room, I continued working on the multi-user function together with Ming Hong and Wilson. After much testing and debugging, the whiteboard finally supports multi-users. However, we found another problem:

red circle: 1st laser on screen
blue laser: 2nd laser on screen
red square: 1st marker created
blue square: 2nd marker created

Test case 1:
The first marker was created by the 1st laser on screen and the second marker created by the 2nd laser. 

Results 1: 
All functions working well.

Reason:
1st laser created the first marker and 2nd laser, the second marker. Hence, working fine.

Test case 2:
We let 1st marker idled off and released the second laser on screen and shine it again before it idle off.

Results 2:
The laser that appear again could no longer control the marker on screen. 

Reason: 1st marker idled off, left which 2nd marker on screen. Second laser released and appear again, second laser is now first laser. Hence, could not control the marker on screen.

Test case 3:
We then switch the lasers; 1st laser controlling 2nd marker and 2nd laser controlling 1st marker.

Results 3:
The lasers could not drag or draw using the markers

Reason:
The markers can only be controlled by lasers with the same index.

The problem exist because the codes used for check the dragging and drawing are separated we have to combined all the codes into a patch in order to solve this problem. Just before we are about to leave the company for the day, we found out how to use persistent memory in Quartz Composer.

03 Feb
Wilson was asked to join Ryan and Leonard in the 3D loader application and I will continued working on the multi-user function. We started debugging on where we had stopped yesterday and we found out that the multi-user function is working when we had combined all the codes into one javascript patch. However, the markers seems to be stacking onto each other we cause the marker to break and appear to be buggy. Thanks to Ming Hong, the problem is solved in no time.

After that, we tried running the Quartz Composer file on Cocoa to fix the overlay problem. We found that the x-coordinates is abit off as compared to the orginal Quartz Composer file and we also managed to solve the problem of the overlay.

04 Feb
I did a couple of testing on the multi-user function once i reached the office to make sure that it is working well. After that, we work on the "Clear All" function when toggled on/off and we found out that the GL Quad in Quartz Composer is actually drawn using 2 triangles leaving a gap in between. Hence, whenever we toggle on/off there will be a diagonial stroke in between. 

Ming Hong then tried using 2 triangles with 1 of them overlapping but the problem still persist. Hence i suggested Ming Hong to create a triangle greater than the screen itself so the stroke could not be seen.

We then updated Kevin on the progress. Kevin found that its a little unnatural for the users to write as their have to write it in one stroke. He suggested to create a radius from the point it stop drawing so that when the laser is released and appear within the radius again, the user could still continue to draw.

05 Feb
We continued working on the function where it check the radius for drawing. We then left for NUS to attend a talk for poly students.

06 Feb
We tested the function where it check the radius for drawing. After that, we updated Kevin on the progress. Kevin find it hard to drag the marker and draw. so we increase the dragging and drawing area of the marker and then we update him again. 

Everything seems good except it is quite irritating that we might end up drawing instead of dragging because we could not accurately point to the dragging area. Hence Kevin suggested a timer that would disable drawing from a certain radius after a certain time. He also suggested a few more functions which could improve the application.
  • When laser is shined, a new marker is created
  • Changed the area of the "Clear All" function. 
Reflection:
This week, I learned that working on Lightdraw making its application multi-user is never easy as the Operating System was designed for single user. After a few month working in IHPC, I've learned what is a good application, having good functions is not the only thing, the simple user-interface, the ease of use all plays a part in it. Even though I have not got a chance to work on the 3D loader application yet, but as long as we keep each other updated, I think I could catch up with them in the shortest time.