Friday, November 19, 2010

19 November 2010

Touched up on the scaling of the 3D models in the morning. Now the object is scaling nicely. Kevin then came in and we discussed on what to do next. Here's a picture of what we have discussed:


We would be following the schedule stated on the top right corner of the board. Left the layout and gesture for the last as we have to wait for the iOS 4.2 SDK to be released, so that we can work on the iPad.

Lunched at Clementi with Kevin, Calvin and Zac. Went there as Kevin wants to buy the iPhone 3D programming book. We ate and then went to get Koi bubble tea. Hehe. It was a really funny experience. Shall not mention the details here! :P

After lunch, we came back and I added in the part on 3D model translations. I already had it done up previously, just had to port it over to this project. With this, we have our version 2.0 up and running. Spent some time solving memory leaks here and there.

*edit* translation was not working well. Had to tweak it here and there. Spent some time trying to understand what happens when the model moves in the negative z-axis. Somehow got the formula up, but still have to try it out on Monday to see if it works.

Thursday, November 18, 2010

18 November 2010

Got quite a lot of things done today. Completed the port over for swipe gesture rotation to OpenGL ES 1.1 today. Not much changes had to be made, so it was fairly quick. Still, individual object interactions with multiple objects loaded was not catered for yet.

Moved on to make use of pinch gesture for scaling, and managed to get it up. Still got some tweaking to do tomorrow though. Got to watch the podcast lecture first.

With that done, Zac and I then moved on to research on how to interact with individual objects. We found 2 different approaches. One of which is to make use of radius, the other is to make use of colors. After weighing the pros and cons, we decided to go with colors first. Got things working out nicely at the end of the day :) we're able to do individual object rotations with multiple objects loaded onto the view.

Tuesday, November 16, 2010

16 November 2010

Completed the rotation of a single 3D model before lunch today. Did it by doing some matrix multiplications. I first created the matrix for rotation on the y-axis, then another for rotation on the x-axis. By multiplying these 2 matrices, I was able to get the final rotation matrix, which is used to transform the 3D model. However, there are still some faults here and there. I brought this up to Kevin and was told that it is fine for now. He mentioned that in order to solve this, I had to look into an even more complex concept, quarternions.

With that, version 1.0 was up. However, all 3 of us realized that OpenGL ES 2.0 is stumbling us. After some discussions, we decided to move to OpenGL ES 1.1. Hence, Zac and I are required to archive what we have done in OpenGL ES 2.0, and then modify those codes to fit in OpenGL ES 1.1.

Many applications out there simply load an EAGLView for the whole application, without incorporating controls such as UITableViews, UINavigationBars, etc. Currently, we are being tasked to look into the proper way of having additional controls together with the EAGLView.

Oh and one more thing, we celebrated Calvin's birthday today at Infuse (level 14). Tomorrow's Calvin's birthday. Happy birthday Calvin! :)

Monday, November 15, 2010

15 November 2010

Continued working with user interactions today, and the focus was on the swipe gestures to rotate the 3D model that Zac has imported. I was able to get the up, down, right and left rotations up fairly quickly. However, that was not what I wanted. I was only either able to rotate up and down, OR right and left. If for example, I do a right rotation followed by an up rotation, the model goes haywire. It does not rotate properly.

I then moved on to find out how to do simultaneous rotations on both the x and y axes. From there, I looked into matrices as they are the ones controlling the model's transformations. I had a little knowledge on matrices as I took additional maths in secondary school, but I was not very good at it. Did some research by reading through the explanations on iphonedevelopment.blogspot.com blog and the OpenGL ES redbook. Got to understand matrices a bit more, and managed to improve the rotations. There is still some faults here and there though. Have to look into matrices more tomorrow!

Sunday, November 14, 2010

12 November 2010

Gained a better understanding of the glFrustumf today. Had some discussions with Kevin and some colleagues that he brought in. They were really helpful and seriously intelligent.

We realized that the normalized device coordinates always ranges from -1.0 to 1.0 on both the x and y axes. Hence, during the translation of window coordinates to normalized device coordinates, I have to scale the values down. With this, I was able to translate the positions properly.

The next thing that I am trying to solve is the problem with perspective. If the zNear and zFar values are not in the positive range, we would not be able to see any perspective. If we have perspective, the translation of coordinates would not be displayed in the way that we want it to be. Hence, I would have to spend more time trying to understand how this works on Monday.

Spent some time looking into swipe gestures as well. Earlier this week, I was only able to do swiping in one direction, left to right. I found out that we are actually able to swipe up, down, left and right. Now the next thing that I want to look into is if swipe gestures would work when I have pan gestures added to the view. These gestures does not seem to work well on the simulator. I might probably request to try this out on a real device to see if it's a limitation on the simulator.