Saturday, March 5, 2011

Diary During Vacation 1

On Thursday night, I worked on adding Knot A Problem the ability to load and changed textures. I worked based on the demo code that had not yet been lit and textured. This functionality is one of the essetial features of Knot A Problem and is not supposed to be hard to implement. However, because of wrong definition of VertexDeclaration, I could not get it work for 2.5 hours, and had no mean to find where the problem was. In Friday morning, I realised that I could have a check through all the code to see if all user difined primitives match with each other. Then the problem was found in vertexDeclaration: it should be of type VertexPositionTexture. Changing into this, the string was then textured with any texture I provided. Then I also created 4 texture images and loaded them manually. With texture, the string looks very exciting. Now it's ready to add more test code to allow user to change the texture by pressing a pop-out button.



No comments:

Post a Comment