Here is the screenshot of the PIX:
As for assignment 6, I changed the Maya exporter to export the file format exactly the same as I did before. So that I can use the parser that I wrote before. Here is the screen shot of the mesh.
The binary files is the easy part, in order to get every mesh info in three load, I create a new struct for the extra information I need (vertex number and index number), something like this:
//load binary file
//load vertex and index number
myFile.read((char*)&m_info, sizeof(VertexFormat::info));
m_vertexData = new VertexFormat::data[m_info.vertexNumber];
m_indexData = new unsigned int[m_info.indexNumber];
myFile.read((char*)m_vertexData, sizeof(VertexFormat::data) * m_info.vertexNumber);
myFile.read((char*)m_indexData, sizeof(unsigned int) * m_info.indexNumber);
Anyway, i'm able to load any shape from Maya into my renderer with my own file format, which is kind of exciting.
Here is the screen shot of scene:
Control:
To control the point light:
use "I" - up, "K" - down, "J" - left, "L" - right, "U" - backward, "O" - forward;
To control the camera: Arrow Keys
To control the box: WASD.
Link to the code:
Graphic 06



No comments:
Post a Comment