Welcome

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

Thursday, December 30, 2010

Day 60 - Last day of 2010 work in the office

Today came back to the office and started to continue working on the problem we identify as the translation issues from different object. First, we manage to fix the translation on the different z axis that each object have from the clip. This make the translation more accurate although from the visual we couldn't really tell.

After that we went on to the second problem. The translation for different object seems to be the problem with their different unit of axes. We try importing different object first to see if we get the same result but apparently it doesn't. However, the object work fine individually. So alex continue meddle with it. He then found out that because the object is too small so he scale up, and this cause the axes of x,y,z to unit to be larger.

So now we found of is the scaling problem, we went on to search the libraries for methods to reading the scaling matrix. We went on to fix it after working on the formula for a while. Everything for the translation seems to be working perfectly find now. What a good way to end our work in 2010 =)

Wednesday, December 29, 2010

Day 59 - Where are you?

.... still working on the translation issue. Seem to me as not able to get it. Kevin came over and i explain to him about what i think. This time round i think that it get more clearer now.

After a while, the translation start to yield result. Just as the path that i expected. Mange to move on working on the other translation issue.

Work with alex to get some other working like the translation when not selecting any object moving to a object cause it to fly. Also the problem of not going into gesture began when it is call.
Everything seems to work for the first node that is draw.

The other node that is imported from other file to the pod scene fail to work when drawn. The translation value is the same for both object, but it seems to translate more than the other those. Believe is the problem in generating the pod scence.

Tuesday, December 28, 2010

Day 58 - Exploded

Yesterday before leaving office, found out that the exploded formula have problem with node count of 4 and lesser. as 360/4 or less would result a value of 90+. This would cause tan(degree) to produce a result that is not correct.

So i went on to fix this problem by specifying the exploded view of the translation when the model have less than 5 node count. The time require was actually quite short as i only have 3 scenario to do.

After lunch, i went on to help Alex with his problem the translation of the object. I believe that the formula that he did earlier was the correct 1, rather than finding other solution i decide to dive into the problem that might cause this formula not working to the result we expected. The first thing i did was to draw a plane at the near clipping plane. After doing this i found out that there must be a distance from the camera to the object even if the object is not being translated.

I did manage to prove what i thought and explained that to Alex to let him know about the chance that this could happen.

“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime”—Author unknown

“Give a man a fish; you have fed him for today. Teach a man to fish; and you will not have to listen to his incessant whining about how hungry he is.”—Author unknown

Monday, December 27, 2010

Day 57 - First day of work after Christmas

Its monday and the day after christmas, it hard to get my engine started for work.

Kevin back to work after his holiday, we explain to him about what we done and what we have not done. It slightly embarrassed to say that we got more than half of the task still not yet complete. I told him about the problem in translation and how did i plan to get it working. He describe to be a more simple one that is still logical.

Went on to work on the exploding of the object for the remaining of the day. Spend time calculating the formula of the object to be divided by 360 den * tan(degree) and blablahblah. Trying to get the formula working before i even started to code. So i spent almost more than half a day to do that.

At least my effort did paid off. Manage to set up the exploded view just as expected from my formula result but still translation is a bit of the problem.

Friday, December 24, 2010

Day 56 - Half Day Work at office today

Today is Xmas Eve, Merry Xmas if you are from US and Happy Xmas if u are from UK =)

Well although is Xmas eve, still got to come over to the office to complete a half day work. It seems that everyone looking really happy today, even the strangers in the train, or colleague in the office or maybe it just me.

The mood now is definitely Xmas mood, but still need to get some of the leftover work done like the changing of texture while translating. After yesterday understood about how the binding of the texture work, it wasn't much of a difficulty to change according to the translation. Just calculate the differences in the axis when the value is translated and change the texture according to the full screen bounds. Manage to get it done pretty quickly thou but still have way to optimize it.

So while i still have time i write up a simple if else to only change the texture when the translation to another texture so that it will not alway be binding texture to the plane even when the texture currently displayed. This way only the texture that is going to be shown will be bind, this would improve the processing speed.

Thursday, December 23, 2010

Day 55 - Texture and Translation on Cutting Plane

Day 55 is Xmas Eve's eve.. Already can feel the xmas mood now. Town, shopping center, mrt are all decorate with xmas item!

The fact i love xmas is whenever xmas is coming, a year is ending. Every time at this point, i will start thinking back on what had happen so far this year. Thinking back on the memories, epic moment and etc. Sometime couldn't believe that it happen so long ago. Anyway Merry Xmas everyone =)

Well still have to work today, cont working on the translation on the cutting plane. By apply texture on the cutting plane work fine. However i did notice that the animation start to get laggy because apply apply the plane cutting, where i suspect is due to the texture. I remenber that when reading on Jeff blog the texture should only be loaded one time if possible so that it will not cause memory issue. The way i am doing it is actually loading the texture to the texture2d every frame x30 per sec. This is really alot. i try various way but i cant because i have texture for the model node as well. After reading more and texture and see how the podloader applying the texture that don't cause any problem, i believe there must be a way to do it. So i decided to read up more before i start trying again. And YES! solve the problem with

glBindTexture(GL_TEXTURE_2D, m_gridTexture[0]);


So now will continue working on the translation to change the texture when moving in and out of the z axis. Its hardcoded still but it does look nice when u see the texture of the plane changing as u cutting.

Wednesday, December 22, 2010

Day 54 - Clipping Plane is Cutting

Continue yesterday work that is to calculate the normal of all the plane.

There is alot of project or sample code that i get from already have method to calculate the normal from the vertices of the object. I read through that and it is actually quite complication or overwhelming on what i need to do. All the previous project i dl-ing will calculate the vertices for a non-flat plane object which each set of vertices would have different normal. and some even go on to divide by the number of face being reuse to reduce the normal. I got really confuse at first so i read the iPhone 3D programming. The godly book that have been helping me for very long.

As i read the chapter i understood more about it although there isn't any build in method or provided method to calculate the normal. But at least i understood that i am creating a flat plane that mean all the normal from any set of vertices would produce the same result! So i went to read up jeff blog on calculating normal. Then i make use of some method he have in GLCommon.h to calculate the normal of my plane. After some try, finally to get it working. I also manage to apply rotation to both plane and the clipping. It wasn't difficult but the fact that it work prove that my understanding of drawing a plane at the clipping edge is correct!

Now got to hardcode some image and test the changing of texture when the clipping plane is translated tomorrow.