Welcome

This is a blog sharing what i have learn and experience from my internship in A*Star IHPC
- Zac Kwan

Monday, January 31, 2011

Day 78 - Fixing bug here and there.

Big rain on a monday making it even more blue.

Today was super duper cold. Wearing a singlet + a polo T + a jacket and i am still feeling cold. Came to office, planning to work on the research on animation. Kevin came after a while to get us to do the animated model and show him that.

Alex is already familar with the model animation, manage to get one working without much time needed. But while loading the model, i tried a different way and found some bug in it. Trying to find the problem to that bug but is actually quite troublesome to solve it. We decided to show kevin the animation model first before attempting to fix that.

After lunch, came back to fix the bug we found. The bug is actually on the loading model and downloading when i doesn't have it. We took awhile to solve it but found more bug after that. More bug in loading the model when it is not there. When we fix that found out that the nodes is not being send when first run. After adding that, we found another bug that the table is not updated when the node is not being drawn. Manage to get all the bug fix, at least those that we have found.

Overall i really satisfied with what we have done in the project. Because if during the start of my intern, and i am being expected to do out something like, i would thought this as extremely difficult.

Friday, January 28, 2011

Day 77 - Finish touch.

Not quite a finishing touch on the project but at least for now that going to be less on code for this few day. In the morning, fix some issues of the bonjour networking and got kevin here to try it out. Everything goes really smoothly, no much of a problem yet only for some minor changes.

After the try out, we discussed again on what need to be done now. As we have completed most of the function we wanted, not is left to do some that we didnt manage to do it. We need to research on why this function can't be implemented, what is the error behind it and also what to replace it with.

After lunch, we came back working on some the research of why compareview cant be done. At about 3 pm went for a break at Starbuck with Kevin. We have a nice chat with him and he also told us about some of his past experience working here. We still owe him an answer on if we want to continue working here.

Thursday, January 27, 2011

Day 76 - Done with most, improving the UI now

Continue working on the bonjour locking parts. After some thinking when i was on the way home yesterday, still doesn't understand why part of the byte is being stuck in the queue and doesn't get send over. Came up with two solution, either create a thread to run and will stop after 1 sec to unlock with a timer that will be reset-ed when data is received. The other one is to add in a method to send the package without splitting and queuing.

We decided on the thread at first, so we started researching and find document about how to get it working. But it look pretty tedious and is process unfriendly. So we went back to the sending package without queue. After looking at the old project, we set it up pretty fast. BUT, the result wasn't what we expected, found out that because during receive data, we will look at the package received and join it together, but because this is a special case, it didn't go pass the loop. We thought about it, but there seems to be no way fixing it.

After lunch, we work on the thread locking. But alex have found out with something in the documentation that uses perform selector after 1 second. So i googled it and found a post that someone is trying to do something that we wanted as well. Manage to get it set up, and get it working too! But there are some flaw in it. We make use of other build in method to solve it.

The rest of the day is spent correcting some code and also swapping the pitch gesture with the tap gesture function.

Wednesday, January 26, 2011

Day 75 - Continue working on unfinished bonjour

Its 3 quarter of a 100 days spent in the office during my intern! Pretty much the same today, working on bonjour, still got quite alot to be done.

During the first part of the day, most of the time was trying to fix the loading issues if the server started loading a model and playing with it before other user join. There was quite a lot to work on as previously for transformation sending we are += -ing to the result, but if the user have not connected, he would not be able to get the correct transformation value. Secondly, what i did yesterday was just saving the last transformation, but it will only be on one node which is not correct. Changes has to be make on this two to get it working.

After lunch, we continue working on the other part of the project. Trying to lock the touches when began and unlock when ended. However first the touch ended wasn't able to be call, but after some googled, alex found a solution. The other problem arise after that. It seems that sometime the touch ended call the send data to unlock method was being stuck on the queue of of the sending. It is not suppose to as all data should have been sent out. Still trying to figure that out and solve that issues.

Tuesday, January 25, 2011

Day 74 - Back to the office.

After yesterday tiring ndu medical assessment, today is back to office work. Alex written in my notebook what he have done so that i can continue from there. That a good way , it help me understand.

So i continue working on what he have stop. Adding in the exploded view function and also clipping plane function to be able to send to user that is connected. Putting everything into a dictionary with and then archiving it. Is, easier say then done. Spend about 1st half of the day to add the explodedview before rotation and translation. Also amended some code to look more neater.

Back from lunch, continue working on clipping plane. This part start to get easy as it is just copy paste and change. However, it still take time. Also testing is difficult as i everytime have to pass a copy over to the macbook beside me and then test it. When some simple code is left out, i have to redo the process of copy, move to the mac run and test again. One person using two mac is not easy.. haha

Well at the end of the day manage to finish what i wanted, more difficult stuff needed to be done tmrw =)

Friday, January 21, 2011

Day 73 - Bonjour Bonjour

Working on Bonjour!

Yesterday manage to detect server and also set up connection to it. Now trying to send NSString over bonjour. It wasn't difficult if it was just that, but because we need to plan far ahead that what would be the best way to work, having multiple user connection, sending gesture or transformation and also ip to decide which user get and set which object. It took us about half a day before successfully sending a NSString over.

Wasn't really a good day today, today lunch went to holland drive, take a quick 1 and decided to come back to complete the loading of model at least so we can slack awhile after that. However wait 40min for the bus then heard from people around there that the bus broke down. Follow what others did, took the HB bus trying to change to D. However, D was off service at the time we reach there. Bad day.

Decided to walk back and reach office at ard 215. Finally manage to get started working on the project again. Manage to load a model to the client remotely, however the next time we trying to do is download the model if not in document prove a stumble block. Try various method, brainstorming, but couldn't get it working. Kevin came before we leave the office telling us about what he wanted which simplified things for us now. Hopefully can be completed on monday.

Thursday, January 20, 2011

Day 72 - Mirror View

Back to iOSBonjour. After yesterday short discussion, we decided that we have to move on to mirror view first before loading two model on the same view as the error still persist and appear unsolvable now.

So i start looking at the iOSBonjour code and was quite glad that luckily last time the server class we did it in a dynamic way. Now all we have to do is drag it into our project and we can start a server. For the join server, we spent sometime working on it.

After lunch, Alex and I watch a movie name the catfish. Kevin show it to us as it is going to expired in his account in the next few hour. Quite a nice documented movie that talk something about facebook in people life. It get creepy at the middle part, but at the end is actually quite saddening. Was glad that the ending was quite a good one.

After movie we continue working on the app. Manage to set up server and connect to it now. Well that is the so call easy part in the other difficult stuff. We will be working on the most difficult stuff tmrw. Transfering package over from one user to another. Hopefully it will goes well.

Wednesday, January 19, 2011

Day 71 - Modifying the application

First thing to do today was to modify the annotation button that we added when long press gesture is detected. Moving the button slighting upward so that the place the user touch is excatly on where the pop up button come from. Afterward also changed the way to close it by setting all touch is detected, the gesture will disappear.

BTW, just before we went for lunch, received an email from apple stating that my app is approved for sales! It was kind of faster than i expected as i thought it would take about close to 1 week. Told kevin and alex about it, they were my first two customer =). FYI my app is Photo Album Scrapbook. Try it!

After lunch, we continue working on the other half of the project. Trying to integrate two eaglview on the same viewcontroller. It have some error that cause quite randomly that i couldnt really understand if it was eaglview problem or the pod library problem.

Monday, January 17, 2011

Day 70 - More function

After all the stuff that we discussed on friday, we continue working on some stuff that is still not completed. Mainly the parallel downloading of the model from the dropbox, deleting of model from document directory and also the annotation on the node pressed.

Most wasn't that difficult but sometime when implemented, we notice some more bug from other place where we have to fix it. Trying to make the program more dynamic and ensure that the whole program look presentable at least to be able to attract user to look at the other function.

We spent about close to a whole day completing all this, after that we had a discussion with kevin about what to do next. Beside some slight modification to the annotation, the next time we needed to do is to compare model. Well is sort of a big function as we needed now another eagl view to be added to the presentation screen.

Friday, January 14, 2011

Day 69 - Fixing interface and program design

After implementing the download and upload of dropbox file, we are now fixing on the interface and also the program design.

First, the interface improvement is changing the way modal view present, placement of some button and also the color of text and such. Although in programming wise, this doesn't really cause much program, but it still require some time to be able to complete it nicely.

After lunch, we try to fix on the program design. By program design, i mean that how the program should work, like if we allow multiple download or single download, disable some button when downloading? or does not allow modal view to dismiss and blah blah blah.

All this got no right or wrong, but is a matter of how we see the user would prefer. It do cause some problem at first, as some control are not public and cannot be use by other class. But after careful consideration and modification is done to fix it.

Thursday, January 13, 2011

Day 68 - Dropbox api

Feel really good today somehow, maybe is because my app is about to submit to the app store for review and throughout by journey to work i did not encounter any bug when playing with my app!

Although slept at around 2am, but does not really feel any tiredness. Came to the office, immediately i went on to fix the problem i have yesterday. As i was going home yesterday i thought of why it does not work i actually think that i found the solution. So i apply it today and it work! Sometime a bit of rest and think over again really help solve the problem.

After fixing the issues, saving and reading work perfectly now =). Continue working on the remaining part of the project, trying to read the text from .txt in the dropbox folder and also displaying a new view to show the description. But actually spend sometime on fixing some bug i discovered before i actually go into it.

After lunch, start to work on that, manage to actually set up the view to retrieve the text information from the .txt file. Its seems like today was really smooth journey. And also the location of label on object seems to work pretty well now! Not exactly sure why, but i believe is because alex changed the pivot point and other stuff which cause it to work now.

Wednesday, January 12, 2011

Day 67 - New Functions

As we have almost completed with the rest of the function, clean up have been done, its time to add in more function.

We discuss about the possibility of this project again, with the gesture function almost complete, most of the other stuff left is to how to put file into it and how to make allow upload and download folder. There is database, website, and this and that. But we chosen the new and quite popular 1, dropbox. As we only need a place to read file and download file, setting up database or website is like a lot to do for a small task. We decide to use dropbox api.

The rest of the day, i am analyzing on how to use dropbox api and looking at the example. The api is pretty good, everything that we needed is covered nicely. Although the example is a really brief one, but it is good enough to get started. Most of the time was actually trying to see which delegate is being called, as alot of delegation is used. Most of the it can be tell by the name, but sometime the order in which it is call isn't that easy to tell.

Before leaving office, manage to set up the log in and read the meta data of the file.


Tuesday, January 11, 2011

Day 66 - Translation Translation Translation

After fixing the exploded view to ensure that all the object is being kept on screen, the translation is causing problem again.

Not because of adding the fix that cause the problem but rather the problem existed just that we didn't notice cause the object is near to camera so is hard to tell. But after adding the exploded view and moving the camera away, we notice that the object is actually flying further then the mouse translation.

We cant really think of anyway yet to fix it. I try on looking back the other project and see what wrong with the formula. Can't really tell any differences but it is just not working. After long time, Alex found a problem that is a mistake by me in adding the z axis to the camera z when retrieving the camera value. Is not needed because the camera z value is already added with z axis.

However there is still some problem to fix.

Monday, January 10, 2011

Day 65 - Move the camera back. Translation again..

Monday, back to the office, it started to rain for the past few day. Continue working on understanding the pivot point in the object. Googling for answer on why pivot point does not work even when changed.

After a while finally understand that openGL does not read the pivot point. Pivot point is actually for the object in the modeling software. We also make another discoveries that trying the scene center should work out when rotating. We did that and it work. However the center in the object are unable to be change. Everything seems to be defined when the model was being drawn before importing. Look like we just got to make do with what we have.

On the 2nd half of the day, we work on the zooming out of camera in exploded view. When in exploded view, some object will be cut out of the screen as they are rotated close to there. So we now use a algorithm to actually move the camera out by a number of z axis from the furthest object so that all the object in the scene will be able to see.

After finishing that, as the object is further now we could see that our translation actually is having some bug.

Friday, January 7, 2011

Day 64 - Reinstall OS and 3D modeling software

Its friday, weekend arriving. The last day of the week, no much coding was touch. We did reinstalling on the bootcamp on Mac laptop and also 3ds max studio. This took up about all the hour before lunch time.

After lunch, we started working on the pivot point of the object. We try changing the pivot point of the object in 3ds max and import into code. However is not being change at all when we import it in code.

We tried various way, look up on how to do it and still not getting the expected result. We suspected that there is problem with the plugin to export to pod file. Did some research online and found out that there are a few people also have such problem when trying to export to another format and import it into another application.

So now the question is, is it the application, the plugins, or just that we are doing it wrongly.

Thursday, January 6, 2011

Day 63 - Clean up and modification

Still having the same problem with the label, asked kevin over to discuss about it. Updated him about everything we have done so far, the way we done it and the problem that is occurring.

We decided to do some clean up on code. Make some changes to our program to look better. So spend the day cleaning up code and writing comment. Some of the changes made are added a button to reset the clipping plane.

Once clip, the plane will stay there on screen. Decided to add in clipping plane rotation and also translation. Now the clipping plane can rotate and translate on different axes. It looked much better now, i think because when u shown the clipping plane, naturally the user would want to manipulate the plane rather than the object.


Tuesday, January 4, 2011

Day 62 - Changing of Plan

Kevin came over today and discuss with us again about the label. He thought that the label with a line was not worth the amount of effort to get that effect. Although it was difficult to implement, but it was actually difficult to maintain the code as well. He decide to use the tap and show label method.

I did try to tell him to use this label, but i didn't say it in the way that he did. When he say it this way, it seems to be more convincing to change it to this way. Look like i still have to be clearer on bring my point across.

So, we now started working on the longpress to show label, it wasnt that difficult i believe. But the mkannonation class that we thought we could use, it can only apply on the mapview. UIView does not allow any of it. There is undocumented apply api, callout, but is really not a good idea to do it. We are now still looking at way to work around.

Monday, January 3, 2011

Day 61 - Happy New Year.

Its 2011, happy new year everyone =)

Started my first day of work in 2011 now. Enjoy a lot of fun and laugher with friends. But now is time to get back to serious stuff.. WORK.

Back to working on showing the label on the node. Discussed on various way to do it. We then went online to research on what are the possible way to do it. After hours of research, is actually not being done by much people yet.

We decided to make use of our own algorithm to try and tackle this problem. Our plan is to make use of a circle algorithm to separate the label apart according to number of node. Next use the distance to get the nearest node to the label position. Then following by drawing a line and translate it to the same position.