Thursday, January 17, 2013

Graphics Write Up 1

File Format:
For my file format I went with something I'd used in the past when working on my 3D reconstruction program and also just because it makes a lot of sense.  It's simply an x, y pair per line grouped into lines of three for a triangle with a blank line to separate the triangles visually.  One change I would like to make to the format is including the number of triangles to draw in the first line since right now I just hard-coded that value, which is really bad practice.

Shader Modifications:
Since some of the default shader manipulation used sin and cos to do interesting things I went on to try and see what tan would do and was not disappointed.  So now both my coloring and position are using tangent calculations, which I feel looks really cool especially since the movement clearly distinguishes the two triangles.

Additional Stuff:
Figuring out the correct order to draw the triangles in was certainly very interesting.  I'd initially gone counter-clockwise, which didn't work, and then changing to clockwise ended up working perfectly.  However, one of the guys I was working with had both of his triangles clockwise as well and they weren't working, which didn't seem to make sense.  In the end we decided it was because I was beginning both of my triangles in the same location, the upper left and corner of the rectangle.  We're not entirely sure if that was it in the end, but it does work.

Another thing that was confusing, but easy to fix, was only drawing a single triangle.  After going through the code again I found the logic where it decided how many triangles to draw and changed it to 2.  As I said above, this clearly isn't the best solution to this and I'd prefer to be reading in the first line of the file to figure out how many triangles need to be drawn.

The last thing that took a bit of work was setting up the MeshBuilder tool.  It probably would have been easiest to completely copy the TextureBuilder tool and then just rename everything, but instead I created a new project and then copied each file over individually.  As a result my project properties weren't correctly set up and so I went through all of those and tried to set them up.  In the end I missed one, which messed up some of the Windows specific code, but a quick Google search fixed that.  I'm also glad I went through this way since it really helped to learn how all the dependencies worked and where everything was being loaded in from.

Pix Screenshots:



Code to this first assignment can be found here: http://www.eng.utah.edu/~jthummel/graphics/

No comments:

Post a Comment