Wednesday, November 10, 2010

10 November 2010

Continued with the movement interaction today. Had a short meeting with Kevin and Zac to discuss on the formula to use for translation. That didn't seem to work well either. We went on to research more on glOrthof and glFrustumf. After some explanation by Kevin, I slowly got to understand more of what they can do.

Hence, I went on to work with glOrthof first, which is for 2D models. I applied the formula that I came up with and finally managed to get what I wanted. From there, I then moved on to make use of glFrustumf, to work with 3D models. All seem to work pretty well, but my cube doesn't seem to be a cube anymore. Or probably it is. Got to look more into this issue and solve it by tomorrow!

Looks like I would have to work with more mathematics in time to come. Wish I had put in more effort in mathematics during my secondary school days :S

Tuesday, November 9, 2010

09 November 2010

Continued working on the model interactions today. I decided to first work on the moving of the model. First I did some simple movement of subviews with the use of UIGestureRecognizer. It has quite a lot of similarities to UITouch.

With that done, I then moved on to try out the same interaction, but with the 3D model. I realized that I was able to do a glTranslatef on the model, however, the model does not seem to appear properly. Then I realized that I would have to do some translation of the coordinates. The UIGestureRecognizer uses the Window coordinate, while OpenGL ES uses the Normalized Device coordinate for model translation. Here are some pictures to illustrate the differences:


Therefore, I proceeded on to work on the coordinates translation. Still have yet to work things out properly. The problem now lies in the part where the model crosses x = 0 and y = 0. There's definitely something wrong with the formula that I have come up with. Gonna have to do more thinking, debugging and researching.

I tried to workaround by making use of UIAnimations. However, while doing that, I came to realize that the rendering method is already making use of UIAnimation.

Monday, November 8, 2010

08 November 2010 - Start of OpenGL ES & Project

Kick started the day by going through Stanford University's podcast lecture on OpenGL ES. Completed some basic sample codes of drawing 3D models and rotating them.

Once that was done, we gave Kevin a call and he came over to have a discussion with us. We discussed on the things to be done for our project and split the work among ourselves. Zac chose to work on the first stream, which is to work with the model. Thus, I would be working on the interaction stream.

Here is the picture of what we have discussed:

I would first have to complete the 3 basic interactions, namely rotation by flicking, scaling by pinching, and moving by dragging.

Thursday, November 4, 2010

04 November 2010 - Bonjour Completed! :D

Completed the last stage of our Bonjour application today! :D we were able to do the synchronization of the displays fairly quickly. After that we also spent quite some time on trying to solve the memory leaks that we have. Learnt quite a lot about the Leaks Instrument today. I guess we better do proper memory management next time as we code. If not, we would have to spent a lot of time trying to solve leaks, especially with big projects.

Tried solving the problem with UIAlertView's memory leak, but to no avail. It wasn't much of a big problem though. Found this link while looking for solutions, might come in handy next time :)

This application is just the cherry on the cake. Since we have completed the cherry, it's time for us to start working on the cake. We must complete the cake! Therefore, we are gonna start on OpenGL next week! Sounds fun. Hehe.

Wednesday, November 3, 2010

03 November 2010 - Bonjour, multiple iOS sending data to OSX (listener)

Started the day with the setting up of the MacBook Pro as we need a third simulator to simulate multiple iOS-es. While doing that, we did research on how to go about having our listener receive data from multiple iOS-es. Spent quite a long time trying to do research, but in the end, nothing much could be found. Therefore, we decided to try things out ourselves.

Currently, our application has only instance variables for one NSInputStream and one NSOutputStream. This definitely cannot cater for multiple users. Then I thought that since we have the stream delegate, adding the various different streams into an array whenever there is a new user would not be a problem. I went on to try that out and it really worked. Our server was able to receive data from multiple users.

However, there was still one problem. Data sent from multiple users were merged together as they were all making use of the same instance variable that we have on the server, which is used to store leftover data. We went on to research on how to get the client's device name the moment a connection is established. This way, we would be able to identify the different users and have individual NSInputStreams, NSOutputStreams, as well as leftover data for each user. We spent quite a long time trying to get an answer, but all we could do was to retrieve the client's IP address. From there, we reworked our application in such a way that it takes in the device's IP address instead of the name.

We managed to complete the second stage of the application today - having multiple iOS-es connecting and sending data to the listener (OSX). We would be working on the third stage tomorrow - one client sends data to the server, the server receives the data and sends this data to all connected clients, resulting in synchronized displays on the server, as well as all clients connected to the server.

Tuesday, November 2, 2010

02 November 2010

Kevin discussed with us on some of the things for us to work on. For now, we'll have to work with the Bonjour protocol where one Mac OSX would be the listener, and multiple iOS devices would be able to send data over for interactions to occur.

There are three stages to this. First, we'll have to setup the listener, which is the Mac OSX, and allow a single iOS device to connect to it - e.g. when iPad A does zooming, it would be reflected on the listener's display.

Next, we would have to work on having the listener listen to multiple iOS devices connecting to it - e.g. when iPad A does zooming, it would be reflected on the listener's display. When iPad B does zooming, it would be reflected on the listener's display as well.

Last, we would have to ensure that all devices connected to the listener would be synchronized - e.g. when iPad A does zooming, this would be reflected on the listener's display, as well as iPad B's display. When, iPad B does zooming, it would be reflected on the listener's display, as well as iPad A's display.

Here is the picture showing our milestones:

We have completed the first stage and are now setting up the MacBook Pro to be used in testing multiple iOS devices.

Monday, November 1, 2010

01 November 2010 - Bonjour Application, Verge of Completion?

Completed the splitting and merging of data packets today. It wasn't that much of a trouble. Once we got that going, we were able to solve the rest of our consistency problems over different devices.

After showing our application to Kevin, we are now tasked to include multi-point interactions for the application. Once this is done, version 0.1 of our application would be ready! :D

*edit*
Now we're facing problems with multi-point interactions. The buffer size for data is either too small, or too big. If we set the buffer size to 512, and multi-point interaction occurs, we get an error. If we set it to 1024, and single-point interaction occurs, our application would not run properly as we're sending only small amounts of data.