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.

Thursday, December 30, 2010

30 December 2010

Finally, the pan gesture for translation is completed! The translation for all objects works very well now.

With regards to the problem that I mentioned yesterday, I actually found the cause to it. It has got to do with the object's scale in the scene! Objects with a smaller scale translate lesser while objects with a larger scale translate more, even though with the same translation value. I came to realize that when I went back to take a look at the scenes that I have created. The reason that the cylinders translated so much was because at the point of importing, the cylinders were very small in comparison to the heart model. Hence, I remembered that I actually scaled the cylinders up a lot.

Therefore, we would have to factor in the objects' scale in the scenes as well. Worked that out fairly quickly, and we are done! Hence, for translation, here are the few things that we have taken into consideration for the translation algorithm:
- Camera's Z position
- Object's Z position that is set by us when drawing (glTranslate)
- Object's default scene Z position
- Object's default scene scale

Some improvements have been made to how we pick the objects for translation as well. Previously, every time when the state of the pan gesture is being changed, we would do a check to see which object the user is touching on. Now, we have it changed to such that when the pan gesture has began, we would store the index of the object that the user has selected. This way, we have prevented some issues with collisions.

It is time to start work on labeling next week~

Wednesday, December 29, 2010

29 December 2010

Managed to get quite a few problems solved for the translation today.

I got the camera position factored into our translation algorithm, and scenes that only have objects drawn at the near plane can be translated properly. If there were to be multiple objects in the scene with different z-axes, the translation would not appear well.

What needed to be done was to factor in the translation vector of the different nodes for their individual translations, in particular, the z position. This can be easily obtained through a method that can be found in the library that we are using.

Hence, in order for the translation to work, there are 3 things that we have to take into consideration:
- Camera's z position
- Node's default scene z position
- Node's z position that is being set by us when drawing

Once that was done, I then moved on to look into another issue with the translation.

We have a scene where there is a heart model, and 4 identical cylinders. Somehow, the translation for the heart works very nicely. As for the cylinders, the translation value seemed to be too large, and the objects fly all over the view. We have another scene where there is only one cylinder in it, and it translates properly.

I am suspecting that this has got to do with the way the scene is being created. Tried working with 3DS Max to change the order in which the nodes are being drawn, and also to recreate the camera, but both did not seem to have any effect at all.

Got to do some research on this tomorrow to get an idea as to what is going on.

Tuesday, December 28, 2010

28 December 2010

Spent the day looking for the answer as to why the translations are not working as expected.

After some reading up on the OpenGL red book, I got to understand the viewing matrix better, and what the LookAtRH (by reading up on gluLookAt) method does. I realized that we would have to factor in the position of our camera this time. Reason being that the LookAtRH method actually moves our camera to another position, not at (0, 0, 0) anymore.