Friday, January 28, 2011

28 January 2011

We had a discussion with Kevin today to talk about the things we need to complete before our internship ends. There were 3 main things:

- Research on Animation and model preparation
- Research on the Compare issue
- Work on axis resetting for translation (Probably with the use of quartenions? We would have to seek help from Calvin regarding this.)

Hence, after the discussion, we went on with our research for the animations.

Thursday, January 27, 2011

27 January 2011

Got quite a few things done today :)

We managed to solve the locking issue with the use of a NSTimer. Every time a user receives data, this timer would be started and would fire off in 1 second. If at anytime before the timer fires off and the user receives another set of data, the timer would be reset to fire off in 1 second again. Once the 1 second is over and no data has been received, we would then enable the user interactions. Here's how we got it done:

- (void)unlock
{
NSLog(@"UNLOCK");
self.view.userInteractionEnabled = YES;
interactingDeviceName.hidden = YES;

// End ignoring user interaction if already ignoring
if ([[UIApplication sharedApplication] isIgnoringInteractionEvents])
[[UIApplication sharedApplication] endIgnoringInteractionEvents];

timer = nil;
[timer invalidate];
[timer release];
}

- (void)lock
{
NSLog(@"LOCK");
self.view.userInteractionEnabled = NO;

// Start ignoring user interaction if not already ignoring
if (![[UIApplication sharedApplication] isIgnoringInteractionEvents])
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];

if ([timer isValid]) // Set timer's fireDate to current date + 1 sec
[timer setFireDateNSDate dateWithTimeIntervalSinceNow:1.0]];
else // Create timer with that fires in 1 second.
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(unlock) userInfo:nil repeats:NO];
}

Once locking was done, we worked on showing a label on all connected devices to show who is actually performing the current interactions. We also did a few fixes for our node button labels for them to be hidden whenever the user performs another action.

Then Kevin came in and tested out the whole flow. We were then told to make some edits:
- Segmentation for 3 buttons (adding in the "Compare" button to our current UISegmentedControl)
- Swapping the pinch gesture to do scaling, and the double tap gesture to do explode

We managed to get that done too, and we'll be testing out the flow of mirroring tomorrow.

Wednesday, January 26, 2011

26 January 2011

Continued from where Zac have stopped at yesterday, which is to send the model's current state from the server to the client that has just connected. This is to ensure both the server and the client are viewing the same thing at the same time. At first, we tried to add the last ModelTransformation of every node into an array and send it out to the client who has just connected. However, this didn't seem to work really well.

Then, we decided to use another approach. We would retrieve all the current transformation values for every node the moment a client has connected, and then send these information in an NSDictionary for every node to the client. However, we encountered an issue where the translation for the exploded view is not being applied. It is applied only when we debug step by step. We resolved this issue by performing the operation to explode the nodes after a delay of 0.5 seconds.

Next, we went on to work on locking. Locking here is to ensure that when one user interacts with the model, other connected users would not be able to interrupt until the interaction is complete. Whenever a user touches on the screen (touchesBegan), we would send a dictionary to all other connected users to disable their user interaction. Upon touchesEnded, we would once again send another dictionary to then enable their user interaction.

At first, we thought that this would work. However, it seems that our data that is being sent over to connected users for unlocking is always "stuck", which could be due to the data size being too small. Hence, the other users are always locked out. We tried looking for a solution but to no avail. Got to continue working on this tomorrow.

Monday, January 24, 2011

24 January 2011

Continued from last Friday's work. I first worked on the downloading of models loaded by the server if the model cannot be found in the client's directory. When I completed this, I met some problems with the SVN. I wasn't allowed to do a commit and was told that there were some conflicts, even though there were none. Even the "Resolved" button is disabled. It was probably because I resolved the conflicts on Friday, but did not click on the "Resolved" button - cannot confirm that this is the case though. Spent some time trying to checkout and whole new copy and add in whatever I have done to that copy.

After that, I went on to work on the sending of node transformations from the server to the client and vice versa. At first I tried sending the ModelTransformation object over in a dictionary, and apparently the NSKeyArchiver is unable to encode this class. Hence, I had to retrieve the values one by one and put them into NSNumbers or NSStrings. Once that was done, I just had to get the logic proper for setting of the transformations.

Left a little note in Zac's notebook to update him on what I have done, since he's not here today. He's got this NS diver's vocational assessment going on.

Friday, January 21, 2011

21 January 2011

Continued with the implementation of data sending today. We were gonna have both the client and the server in the same class, which was not what we have done before. What we did before was to have the server in one project, and the client in another. This made things a little confusing for us at first.

We did some careful port over of the codes, separating them under client and server pragma marks. Once that was done, we only had to do some debugging here and there to get the data sending to work.

We then worked on the loading of the models on the client side after the server has selected a model. We then met with the issue of our cells in the table view not being loaded fully before our method to retrieve the model to be downloaded was called.

Then Kevin came in and told us to work in another direction, which is to not show the table view at all and do the downloading in the background, minimizing the amount of user interaction required. Gonna have to get that done on Monday.

Thursday, January 20, 2011

20 January 2011

Back to Bonjour today. After the discussion with Kevin yesterday, we decided to bring over the Bonjour implementation that we have done before.

Since we have not touched the Bonjour implementation for quite some time, we had some problems at first while trying to port over our codes. Fortunately, we did some cleaning up of our codes before, and there were comments to guide us in recalling what the various different methods do.

We managed to get the setting up of the server and connecting to the server done today, and will be working on the sending of data tomorrow.

Wednesday, January 19, 2011

19 January 2011

Spent the day trying to figure out how to load up 2 eaglViews in our application at the same time. Did lots of debugging and reading up on the documentation for the OGLESTools library, but still could not find an answer.

The app first crashes at the part where we do the function call for GetWorldMatrix. I found another function that can be called - GetWorldMatrixNoCache. This solved the crashing when we attempt to get the world matrix. However, the app now then crashes when we try to do the drawing of the models.

We brought this problem up to Kevin, and we all decided that more research should be done. I went back to the POWERVR forums and posted our query. In the meantime, while we are doing this research, we would be porting over the Bonjour implementation that we have done before to this app.