teaching machines

Feature 5

This time, I gave my camera the ability to walk around the map with its height varying with the height of the land. The first thing I did was create a class called Heightmap, which held a width, a height, and a 2D array of floats (heights). Then, I made a couple of new methods […]

Feature 5 Post Mortem

Adding a camera to my terrain came pretty quickly after I generated my terrain, but it took me a while to iron out all the bugs. I also feel like I went at the problem in kind of a strange way, but I’ll get to that later. My cameras controls use WASD for advancing and […]

Feature 2 Post Mortem

Generating terrain wasn’t too hard; the biggest problems I had were simple things that shouldn’t have been problems. I decided to write the diamond square algorithm in c++ because I’m way more familiar with it than I am with ruby, and there were a few things I wanted to try and play around with when […]

Feature 5 Post Mortem

I had some trouble at first getting feature 5 to work. Getting the WASD movement keys to work was as simple as setting the keys to different values from keys.h, as shown below. It also shows where I set the elevation of the camera equal to the terrain height.   I also just used the […]

Feature 2 Post Mortem

Overall implementing the terrain generation and height map was not overly difficult. The first problem I came across was editing the ruby file we created in the tutorial, in order to orient the terrain in the same aspect as the camera. The grid value had to be switched to the center in output as well […]

Feature 1 Post Mortem

Loading .obj meshes into my scene was a relatively straightforward process. I essentially created an array of programs, attributes, meshes, albedos, etc., and looped through each one in the OnDraw() call to display each one. In order to display copies of a mesh, I actually used a vector of vectors of xform matrices. This sounds […]

Feature 3 Post Mortem

This feature is all about lighting.  We’ve covered this all in great depth in class already, so there really wasn’t a whole lot that gave me any trouble.  The lighting includes ambient, diffuse, and specular lighting (using the Blinn method in particular).  Everything I used as a reference came directly from Chris Johnson. Here are […]

Feature 1 Post Mortem

Loading a .obj mesh is a relatively straightforward task using the masterfully written code provided to us by Chris Johnson (Extra Credit?).  I decided to augment the ObjUtilities class to make it slightly more robust.  The utility can now handle comment lines or other odd lines throughout the file, as well as count the vertecies […]

Feature 5

In order to get this feature to work I had to do two main things: Add a terrain class that I could use to sample the terrain height at a given location, and improve the camera class to function more like a fps camera. My terrain class is a height map that is generated from […]

Feature 2

Generating terrain wasn’t terribly hard. At first, I wanted to write my own generator, with an algorithm other than diamond square. I wanted a landscape that resembled mountain ranges more than rolling hills. I got about half way there. The issue was all of the mountains looked like long, skinny ramps due to the order […]

1 28 29 30 31 32 61