Friday, January 18, 2013

Graphics Assignment 1

Link to code: http://www.sendspace.com/file/xznpk7

I created a .txt file to save coordinates of rectangle. The .txt file looks something like this:


-0.5f,
-0.5f,
-0.5f,
0.0f,
0.0f,
-0.5f,
0.0f,
-0.5f,
-0.5f,
0.0f,
0.0f,
0.0f,

The file parser takes a value for x and y co-ordinate from each line. So, the first value of the file is the x co-ordinate of the first vertex followed by y co-ordinate of the first vertex and so on..

I saw different patterns when I tweaked on the values of the commented part of Pixel and Vertex shaders. 



I found it difficult to display the rectangle by using two triangles. Changing the value of the buffer, that is, changing the size of buffer to 2 from 1, and also changing the value of PrimitveCount to 2, I was able to render the rectangle on the screen. 
   

No comments:

Post a Comment