Tuesday, November 8, 2011

My Backpack Student Grading System

At my school, we use an online program hosted on my school's servers called My Backpack to both report grades and assign homework. Over the years, I've realized that getting onto the website takes a while due to having to go through our school website first, and then passing a login screen. This is exacerbated when using a cell phone. So, this was my solution:
I created a mobile app that logs on to backpack and automatically scrapes the data you want to see (grades and assignments). At least, that's the idea for the finished product. As of now, this is what results after logging in on the app:
This is what the website equivalent to this would be:
The way it works is by spoofing the headers of a web browser in a page request. Although inefficient, without an RSS feed there's no other way to obtain the information (I haven't had much success with directly querying the server). Using the HttpClient library for Java, I store the security cookie along with some other required fields and pass the logon screen. Then, I query the server for the page with class info. I use Jsoup (a web scraping Java library) to parse through the HTML for the values containing the class information. This is what I've accomplished so far.

The more difficult task is retrieving the assignments. They're stored on another page, but in order to retrieve them the page header request needs to have a reference to the storage location in the server's database. I haven't yet figured out what the exact mechanism for this is, but once I have I'll be sure to update.


Monday, November 7, 2011

DirectX Port

This image is from the port I started making from XNA to DirectX. Actually, I guess it might be more accurate to say this is a different animal altogether, since I built it from the ground up.

So you might ask, what's the point? Well, it turns out that since XNA is a wrapper library for DirectX, coding this in DirectX gives a significant performance boost.

For an idea of just how much that is, consider the following: in the screenshot of the XNA version everything is being drawn with a lower level of detail, meaning that less vertices are being used to approximate the shape dictated by the heightmap, which translates to less processing power used. If that were drawn in a wireframe mode, it would be easy to see through it. In this image (as I haven't yet gotten around to putting this feature in) not only are all original vertices drawn, but additional ones are created through the hardware tessellation feature in DirectX 11. This means that new vertices are interpolated in, creating smoother curves and more detailed terrain. If I'd taken this screenshot with a wireframe setting, it would look the same due to how many vertices are present.

What's incredible is that this DirectX version actually runs more smoothly than the XNA version. With the XNA version I get around 30-40 FPS, while with this I'm consistently hitting the cap I set at 60.

Friday, November 4, 2011

Video Game


This is a project of mine I worked on back in '09. I figured I wanted to make a video game, but I wasn't entirely sure how I'd make it. After some research online I settled on using the XNA library from Microsoft. The easiest game to make seemed like a generic flightsim, so I started on a terrain generator first. After a while I had some basic normal-based lighting and some texture-mapped terrain. Unfortunately, I never quite got the flying part to be fully functional, but it served as a model for when I later upgraded to DirectX.

After doing some initial heightmap generations, I realized that there was a point where heightmaps got too large for my system to handle. After reading around, it seemed that the solution to this was a quadtree. In this system, the heightmap would be broken up into four sections, which would each also be split up recursively. This would continue to a certain depth, the idea being that only the sections in the camera's view would be drawn. After reading up some of the theory I managed to implement my own version of it successfully. I also created a system where the terrain would be rendered at different levels of detail depending on how far awway the camera was (in the above image, most of what you can see is at the lowest level of detail, save for some at the bottom).

Next, being unsatisfied with the undefined shadows I had I decided to look into shadow mapping to get some sharp realistic ones. The method I decided on involved rendering the scene twice: once looking from the perspective of the light to see what portions of the terrain have light hitting them (this is the box in the upper left corner), and once from the camera (which is what is seen).

Sunday, October 30, 2011

Purpose

So I figured it's about time I started a blog to chronicle some of the things I've been doing. I'll be posting some of my past projects as well as my current one shortly.