Wednesday, December 2, 2009

Week 9 Day 5

Upon continuing on yesterday's problem, I realised a problem with the rotation. The rotation of the rubic cube was not based upon the centre, but based upon the left top most cube.

This caused the cube to rotate around the top left point instead. I tried to change the x,y and z of the rotation and also putting the codes to draw the uppermost middle and centre cube first, but it doesn`t help in anyway.

Finally, I asked Ming Hong and realized the problem was due to the cube being drawn below the origin, which was not shown in the 3d view. I could do 2 things :
-Change the coordinates for all the cubes so that the uppermost middle and centre cube is at the origin (0,0,0)
-Use glTranslate to move the 3 cubesets that I have created to the appropriate position.

I am currently working on the second solution, and hopefully it solves the issue.

=================Reflection=============

Time passes fast, and today counts the last day of Week 9 that I have worked in IHPC. This week saw me coding on OpenGL for the first time in my life. I have now more understanding of how software like games and CAD draws 3D images on the screen and what OpenGL can do.

It has been a week of coding in C++ on OpenGL, which is new to me, but definitely very useful for the development of the HoloTouch project. I have now thought of various projects that I can make use of OpenGL with, and I am planning to code them after my SIP

No comments:

Post a Comment