teaching machines

spiegedj – HW 2

March 8, 2015 by . Filed under cs455, postmortems, spring 2015.

Thought Processes:

I started off the project by converting the magnet pseudocode into a c++ class. I used a class instead of a struct for no real reason other than that I like classes better and I knew that there is little difference between them. I then worked on adding an OnDraw method to this magnet class so the magnets could draw themselves. Finally I set up the mouse click and drag events to correctly interact with the magnets. This required converted a point from the screen space to a point in world space.

Hurdles: 

I think the most challenging aspect of this lab was the click events because you had to figure out the conversion function. Also the requirement of having only one vertex array object tripped me up for a while until I realized how that could be done. Of course I also had some errors when copying the pseudocode and that took me some time to find them all.

Pictures:

It is hard to capture the simulation in pictures. Here is my attempt:

spiegedj_HW2_1

 

spiegedj_HW2_2