Friday, February 18, 2011

18 February 2011

Last day of internship today!

Had a soccer game after 5p.m with the colleagues today. 1 goal, 1 assist! My team lost though. Really, really, tiring. The rain came after playing for around 30 minutes, and we had to leave. Wish we could play longer though!

I'm so gonna miss IHPC...

Thursday, February 17, 2011

17 February 2011

Continued going through the codes with Kevin today. We managed to complete the EAGLView, InteractionsViewController, which includes the gestures. Looks like it would really take him some time to absorb everything thoroughly.

We're gonna start going through Bonjour tomorrow, and if we can't finish it up, we would then be coming back on one day next week. There'll be a soccer game tomorrow too! :)

Wednesday, February 16, 2011

16 February 2011

We had a debrief session with Kevin today. Talked about all the stuff that we had gone through, and Kevin gave us lots of valuable advice.

"Always keep learning, never be the one who knows everything"

This, is really very true. I'm really glad that I've improved since the mid-SIP feedback :) I'm really very thankful to have been attached to IHPC and working with Kevin. He's a really good supervisor. He teaches us not just technical skills, but life skills and social skills as well. Thanks so much Kevin!

Although out internship here would end in just 2 more days, this connection between us would not, I'm sure.

We didn't have the chance to go through the codes today, as Kevin is on half-day today. So I spent the day working a little on my SIP report as well as completing my NUS admission application.

Tuesday, February 15, 2011

15 February 2011

Well well, it's another day of cleaning codes and trying to get the animation up for me. We managed to go through quite a few number of classes today, and they're our really huge classes.

While doing that, I worked with Bernard and we found out that morph animation has never been converted before. Bernard sent an email to the CTO of NuGraf (they develop plugins for modeling tools) and he managed to clarify some issues with us. He suggested us to export the various meshes in Collada format, and then do the shape blending in our code, which is similar to what was suggested by people in the PowerVR forum for POD files. He also suggested us to look into skinning/bone animations.

Oh yeah, Kevin treated us to lunch today! Zac and I actually planned to buy them (Kevin, Calvin and Bernard) a meal, but looks like Kevin beat us to it. Thanks again Kevin! :D Really appreciate it.

Monday, February 14, 2011

14 February 2011

Last week of internship! I'm seriously gonna miss this place a lot. The people, the environment, the fun, the laughter, the work, everything.
...
...
...

Started the day by working on producing a scene in 3D Studio Max with the heart models and vertex animation. Since the 3D Studio Max trial on the MacBook has expired, I went over to Bernard's desk to make use of his desktop. He has the license for 3D Studio Max 2008 :)

He's a really nice guy and very helpful! I got the scene up pretty quickly since I've already done it before. Just that this time I have to document a step by step guide on how to get it done. Several screenshots were included as well.

I first exported the scene into .dae format, but it could not be viewed by OS X Preview. Hence, I took some time exporting to all the available formats that I can find, and begun the search for viewer software that can view models with vertex animation. Then again, no luck. All the software that I tried out did not work properly at all. Some were of very old versions too. Looks like lots of research has to be done on vertex animations...

After lunch, I joined Zac and Kevin in reviewing our code and doing some cleaning up.

Friday, February 11, 2011

11 February 2011

Learnt new stuff again today! But before I go into what I've learnt...

Zac and I started the day by getting our application to send the node button location to and fro. This is so that when one user uses the long press gesture to display the node button, all other connected users would also have the button displayed on their devices. Once we got that done, we wondered if the pushing of the views should be done on all connected devices once a user clicks on the button. Gonna have to clarify this with Kevin on Monday~

Once we got that done, I moved into learning how to create morph animations using blender. It's very different from what I have learnt before in 3D Studio Max. At first, I even had difficulty trying to source for tutorials. There were not many specific ones too. Hence, I had to do quite a bit of reading up and understanding how to make use of the Shape Keys. It actually took me a longer time to do this is blender as compared to doing this in 3D Studio Max.

Finally, I was able to get the model up nicely with vertex animation. However, I'm currently facing some issues with displaying the vertex animation in .dae files. It could be either one of these problems:

- Mac OS X Preview doesn't play vertex animation
- .dae does not support vertex animation (but it's stated in the specifications that they do support)
- Exporter issue (blender's website suggests that there are known issues for the Collada importer and exporter for blender, but no details are provided)

Thursday, February 10, 2011

10 February 2011

We started the day by fixing up some bugs in our application and did some preparations for the presentation in the afternoon. In order to ensure that we would have a working demo, we did several rounds of testing and debugging. We also discussed on the use case scenario that we would be using to carry out the demo at the same time. This way, we have ensured that we do not miss out anything.

The presentation was done to a few colleagues in the advanced computing department, and it went through quite smoothly I think :)

Through the presentation preparation process, we actually found out that the error that we have been facing with the buffer might be dependent on the network speed! We do not experience any errors when connected to the network in our lightdraw lab. But when we are connected to another network, which is presumably slower, we get the error. Still we cannot be sure though. Wondering what's the root cause of this issue...

Tuesday, February 8, 2011

08 February 2011

Kevin came in the morning and told us that we were going to do a demo on our project to our colleagues on Thursday. Hence, Zac and I worked on some presentation slides first in preparation for the demo.

After lunch, Kevin took a look at what we have done for the documentations, and we realized that whatever we had done was wrong. We misunderstood what Kevin meant by a user manual, and we did not go into detail for the limitations document. The limitations document was really important, and we had to find out why we're limited, not just state how we're limited.

Therefore, Zac and I then continued with more in depth research on vertex animations for POD files and the issue with our comparison EAGLViews. I found out quite a bit regarding the animations. It is not that the POD file exporter that does not support vertex animations. Instead, it is because POD files do not support vertex animations, which is why the POD file exporter has no need to export the vertex animations at all. Deforming of meshes cannot be done in POD files!

Learnt more about what makes up a software documentation today. Kevin gave us a short session showing to us the technical specifications and the user manual. These 2 documents make up our software documentation. I realized that in TP, we have only been writing technical specifications documents only. Looks like we still got quite a bit to learn if we are required to write the user manual! I don't mind learning that though, it'll definitely be useful in the future.

Monday, February 7, 2011

07 February 2011

Started writing the documents for our project's limitations as well as it's features. We could not write much for the limitations document today though. Several sources that we have comes from the PowerVR forum, and the forum is down today :S

Thus, we decided to complete the features document first which would act like a user manual.

Tuesday, February 1, 2011

01 February 2011

Continued with research on the animation and comparison issues today! It's Chinese New Year eve tomorrow and I'm feeling so excited~

Monday, January 31, 2011

31 January 2011

Wow, it's already the last day of January 2011! In just the blink of an eye and we've already spent 1 month of the new year.

It's bug solving day today. Found quite a number of bugs in our application as we carried out some testing. Spent most of the time trying to fix the downloading of model loaded by server if not found in directory. It was working previously since we have yet to send any additional data over to the client. However, once we added the part where we had to send over the initial model state, the problem arises. The application tries to apply the model states even though the model has yet to complete the download.

We thought about it for a long time and in the end decided to make use of an array to store the received data while the client is still downloading the model. The received data would then be applied when the download has completed.

That was problem number 1 solved. We then had to deal with the issue of selecting nodes to draw/hide. The table view's check mark was not being updated. This was solved pretty quickly. Problem number 2 down.

We also faced the problem of user trying to perform interactions even though no model has been loaded yet. This would cause the application to crash. Simple solution - enable user interactions only when model has been loaded.

Oh yeah, Bernard took us to the Marketplace today for lunch. We each bought the wrap meal @ $4.50 and brought it to our pantry. There a wrap, a drink, as well as a small dish of fruits. Healthy lunch!

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.

Tuesday, January 18, 2011

18 January 2011

Started working on the comparison feature for our application today. We are able to instantiate another eaglView inside our current view. However, when the drawing of the model in the second eaglView starts, the program crashes when it tries to execute the codes in the c++ library that we are using.

Hence, we suspected that it was the c++ library's problem, but we cannot say that we are sure though. Then, we tried the same thing on an older project that we have. For this project however, we were able to do the proper drawing of the model in the second eaglView. Would have to spend some time looking further into this tomorrow.

By the way, Zac's iPhone app just got approved today. Go search for it on the iTunes app store! Just type in "photo album scrapbook" and you'll be able to find his app.

Monday, January 17, 2011

17 January 2011

We continued with fixing and implementing several interface features today. First, we did the fix for multiple downloading of models from the Dropbox repository. We were actually working on the fix to properly display the right UIButtons when download is completed.

Then we moved on to implement the swipe to delete feature in the UITableView for the list of downloaded models. This also makes thing more efficient when we want to test the program. This way, we would not have to uninstall the application from the simulator.

The next thing we did was to change the display of the labels to show something similar to the UICallOutView. Since the UICallOutView in the SDK is not documented by Apple, we did not want to take the risk of having this application being rejected when sent for reviews in the future.

Hence, we worked an alternative approach, which is to make use of custom buttons. We would create an image similar to the UICallOutView in Photoshop and apply that image to the button. Zac and I struggled a little here and there with Photoshop, but we managed to create the image in the end. Oh and a note, in order to implement some paddings for the text in UIButtons, there is this function:

[nodeButton setTitleEdgeInsets:UIEdgeInsetsMake(10, 15, 20, 20)];

Kevin then came in at the end of the day, and we discussed on what to do next. We decided to remove the "show all labels" feature since we already have a table view that shows all the nodes' names.

To do:
- Model Comparison
- Mirror Effects (multiple iPads on the same network, Bonjour)

Fix multiple download. Fix delete. Do callout view. Photoshop problems.

Friday, January 14, 2011

14 January 2011

Showed Kevin what we have done for the Dropbox implementation. He then got us to fix several issues, mostly to do with the design of the interface. Learnt quite a bit on the adding of items to UITableViewCell, such as spinners and our custom buttons.

Thursday, January 13, 2011

13 January 2011

Got the directory for saving the models and text files right :) we are supposed to save all the downloaded files into the NSDocumentDirectory. Once that was done, we were able to download and read the text files easily too.

While Zac worked on displaying the node descriptions, I worked on the UI for displaying the online models list. Managed to get the UI done properly for the iPhone as well as the iPad. While doing that, I found a better way to make use of tools bars programmatically. Instead of created our own UIToolBar, do this:

UIBarButtonItem *onlineModelsButton = [[UIBarButtonItem alloc] initWithTitle:@"Online Models" style:UIBarButtonItemStyleBordered target:self action:@selector(viewOnlineModels)];
[self setToolbarItems:[NSArray arrayWithObject:onlineModelsButton]];
[self.navigationController setToolbarHidden:NO animated:NO];

Was having some issues with displaying a modal view inside a UIPopover. Got to read some sources online and it was said that apple doesn't recommend that. Instead, I decided to have a popover display another popover view. It worked out pretty nicely.

We got the login page done up nicely too! :D

Wednesday, January 12, 2011

12 January 2011

Continued with the fixing of the pan gesture for translation, but to no avail.

Kevin came in before lunch and talked to us about several new features that is to be done. Hopefully this would work towards our advantage for the extension. Anyway, we first listed down the items to be fixed:

- Translation in explode view
- Rotation (some angles could not be covered)
- Label locations

We would be implementing an online upload/download feature with the use of Dropbox API. We have decided to put all the 3D models inside a Dropbox folder, as well as their respective text files that stores individual node descriptions.

We managed to get the downloading of the 3D models up pretty quickly. Most of the time taken was spent on understanding the sample application provided. They made use of a lot of delegation, which made the understanding process a little tougher.

Though the downloading was done, we are still having some problems with the location to save the files. I was able to save it into the mainBundle, but seems like this is being restricted by Apple. Got to find the actual directory for saving tomorrow.

Tuesday, January 11, 2011

11 January 2011

A nice date today, 11.1.11. :)

Continued with the fixing of the pan gesture for translation. Reviewed the whole algorithm to see what we have missed out, or what went wrong, but still could not get any idea. In the end, I realized that we made a mistake while trying to retrieve the camera's z position after we did the explode. We added an extra value to the camera's z position while doing that, which caused the nodes to translate more that they should. It is more accurate now, but still not at the level we want yet.

Gonna have to try and figure out the problem tomorrow...

Monday, January 10, 2011

10 January 2011

Continued with researching on the center of models in OpenGL ES. Chanced upon this link, and it gave us most of our answers.

http://forums.create.msdn.com/forums/p/56669/345580.aspx

The pivots that we have set up in 3DS Max only works in modeling tools. In order to have our own pivot point in OpenGL ES, we would have to store that information ourself. We did, however, find a solution to the object's center, only when the model is not being exploded. This can be done easily by just setting the scene's center to (0, 0, 0) in 3DS Max.

Now, the problem is, how do we define where our pivot point in our code when every model is different?

We brought this issue up to Kevin, and came to a conclusion that the center of the models would have to be defined by the modeler when he/she creates the models. Whatever point the vertices of the model centers upon would be defined as the center by OpenGL ES. This would solve the issue when models are being exploded.

Then, we moved on to improve the algorithm for the explode feature. The previous algorithm translates the nodes by a certain value, and because of this, some nodes would appear to be out of the screen. We solved this by zooming the camera out by the largest translation distance of the nodes in the scene. While doing that, we also worked to improve the circle algorithm that we have based on some of my suggestions. This made the explode look nicer.

Then, with the improved explode feature, we realized that the translation was not working properly again. The translation values seems to be getting larger the longer we pan around.

Friday, January 7, 2011

07 January 2011

Started the day by reformatting the MacBook Pro and installing Windows 7. There were some problems with the version of Windows 7 being installed previously. Got all the necessary installations done before lunch.

Zac and I started working on adding lighting to our models, and to change the center of the models. Lighting was easy, since we have already done it before. Changing of the center, however, was the problem. We did some research and what we had to do was the change the pivot of the models in 3DS Max. We tried out many ways, but the POD models that we export from the scene still uses the default pivot.

We spent the rest of the day trying to solve this issue, but to no avail. However, I did manage to find an alternative online, which is to manipulate the transformations in coding to transform on a specified pivot. What was suggested was to first translate the object to -P, where P is the pivot point, do the necessary transformations, then translate the object to P. Wondering if this would work, and there definitely are complications. How do we define the pivot point in our program? We would have to discuss this issue of pivot points with Kevin next week.

Thursday, January 6, 2011

06 January 2011

Kevin came over today and looked at our progress. He did some testing and listed down a few things for us to fix.

- Dynamic model list creation
- Reset clipping
- Modify clipping
- Switch off for labels

We managed to get those fixed, and would be working on the following tomorrow:
- Add lighting for multi-node model
- Centre of rotation should be the centre of the object
- Compute explode radius based on z near

Tuesday, January 4, 2011

04 January 2011

Took another approach to implement the labels after having discussed with Kevin. We decided to forgo the drawing of lines and have the labels placed onto the nodes when being selected by the user.

We got the labeling for touching individual nodes done, but there are still some issues for showing all labels at the same time. When displaying all labels, the positioning depends heavily on the translation values of the nodes. Somehow, we are still unable to get the labels' position correctly for this.

Come to think of it, time really flies. In just about 7 weeks, our internship here would come to an end. Looking forward to working here as a temp staff till my enlistment, if possible. It has been quite a while since I received my mid SIP feedback from Kevin. I have been working actively, trying to improve myself. I hope that this would deserve me better grades for my SIP, and more importantly, heeding the feedback given by Kevin would definitely benefit me greatly in the future.

Monday, January 3, 2011

03 January 2011

New year, new start. Happy 2011 everyone! :D

Started working on the labeling of nodes today. Zac and I discussed on what to do and did some research on how people out there are doing the drawing of lines and labels.

Then, we decided to come up with the algorithm for the placement of the labels first, before we start drawing the lines. We modified the circle algorithm that Zac has used previously for the exploding of nodes. This algorithm sets an array that contains objects of NodeLabels.

Kevin came in at the end of the day and gave us some suggestions on how to get this done. We would be putting his suggestions into use tomorrow.