Friday, February 1, 2013

Graphics Assignment 3

Compared to last week, this week's assignment was really simple. It was mainly about adding textures and point lights to our project.

Here's my code
Download

Changes

- Changed the mesh file format to add support for uv coordinates and normals. Its new format is:

NoOfTriangles = n
NoOfVertices = n
NoOfIndices = n
Vertices
x , y , z  |   r , g , b, a   |  u , v  |  nX, nY, nZ
x , y , z  |   r , g , b, a   |  u , v  |  nX, nY, nZ
x , y , z  |   r , g , b, a   |  u , v  |  nX, nY, nZ
x , y , z  |   r , g , b, a   |  u , v  |  nX, nY, nZ
Indices
i1 , i2 , i3
i1 , i2 , i3

- Added a cPointLight class, which holds the point light's world position.

Instructions

- Move the light using W,A,S,D
- Move the camera using the arrow keys.

Check out my cool gameboy texture


PIX screenshot of texture


Notes
This week's assignment was simple because the concepts were really clear to me, I had dabbled with UVs and normals in an XNA project some months ago.
- The only confusing part was figuring out the right UVs for the vertices, since it's a 3D object.
- Apart from that everything went smoothly and the code runs perfectly in both Debug and Release mode. :D

No comments:

Post a Comment