Monday, January 16, 2012

Graphics: Green Army Men

I find it exponentially more difficult applying myself to my hobbies the further I go in my career. Sometimes months go by without me even realizing I haven't hobbied it up in a while. The holidays are even worse. But that's why they are hobbies, right? They are what you do when you have time. This weekend I had time and decided to pick up Graphics. I'm still not sure why, but when I asked myself on my Saturday morning what I was most excited about doing I thought of Graphics. ( For context, my other in-flight hobbies are my dogbot, a quad-copter, and a smaller mill for milling circuit boards. The dogbot and the quad-copter are currently dependent on the new mill. )

Graphics is still a huge intellectual challenge for me, so maybe that's why I was excited to work on it. I don't have enough deep intellectual challenges as of late and as a result I feel my brain turning to mush. For example, it hit me this weekend while coding a c++ Graphics application that the last time the concept of Polymorphism entered my head was 4 years ago! Shame.

I made a decision this weekend that I didn't enjoy making. I decided to throw out my Code::Blocks IDE with its MinGW compiler for Visual Studio Express. I prefer to use opensource, but I don't enjoy fighting for a whole day, just to get a new project to compile. The more I get into Graphics the more I am realizing that all the opensource graphics related projects are native to Visual Studio, so I gave in.

I am currently using OGRE for rendering, Blender for art, Bullet for physics, CEGUI for user interfaces, and OpenAL for audio. I pushed off Lua scripting until I refactor clean integration of renderer, art, UI, and audio.

I'm finally getting to the point where I'm proficient enough in Blender to start having fun. Below is an image of a green army man I made in Blender for what I consider the ultimate graphics engine proof of concept.


This POC is a simple game I wrote incorporating all of my engines and tools. Through keyboard input the player is able to navigate to any position and orientation, and shoot balls at green army men. When the ball is released it triggers a local sound. When the ball makes contact with a green army man an impact sound, originating at the relative location of the green army man in a 3d space, is triggered. All object interaction is handled through Bullet Physics. Real time physics can be toggled on and off, allowing for a cool time freeze effect. The player can still move around, but the objects that make up the scene are frozen in time. Here are a few more images.