Contra 3D

- Anh Viet Nguyen 2009

Description:
- Contra 3D is a short graphical demo of the original Contra game on the Nintendo Entertainment System.
- The demo uses OpenGL/GLUT, MD2 models, and BMP textures.

About the project:
After the initial design stage of the project, I knew that creating a playable demo would be too much work. So I
focused the project more on the graphical presentation of the game, which includes modeling, animating, and
texturing. I used Blender 2.48 to do all of the models, animations, and textures. Since this is my first time
working with Blender, I had to go through a lot of tutorials just to figure out how to navigate around Blender and
how to model, animate, and texture. With these objects in Blender, I exported them into MD2 files. The reason why I
chose to use the MD2 file format is because of the simplicity to understand how it works, the availability of
tutorials, and its ability to store animations. I wrote an MD2 loader that fits with some of the things learned in
class. Instead of using GLCommands and precomputed normals, I drew out each triangle and calculated normals for each
vertices for smooth shading. For the textures, I used my Professor Wood's BMP image loader. I have also written a
camera class and lighting manager that allows me to easily set these up and manipulate them. Some of the other
code I have written handles the character movement, weapons, and keyboard. As a little note, the jump trajectory
follows a parabolic curve while the powerup flies following a sine wave.

The Demo:
Keys:
W - Aim up
A - Aim/Run left
S - Prone
D - Aim/Run right
; - Shoot
' - Jump
Q - Switch weapons
ESC - Exit
You can combine WASD keys to move/aim diagonally. You can also shoot down if you jump, hold down the 'S' key, and
shoot.

Pictures:
This is a picture of my character model in wireframe mode. You should be able to see the bone structure of the
character. To be able to pose the character, you first need to map vertices to the different bones in the body.
After that, you can rotate and translate these bones and the vertices associated with the bone will move.


With the bone structure in place, I would pose the character at certain keyframes and this allows me to create
an animation. On the right side of the screen, you can see all of the keyframes I have saved for each of the
animations.


Below is a picture of the UV map I made in Blender. I would use this as a template to create a texture for my
character.


After a quick work with Photoshop, I get all of the necessary colors down for the character.


Here is a cleaner texture that I made for the stage.


This is a sample of the background forest texture I drew in Photoshop.


Lastly, after putting everything together, the result is something I am quite proud of.


References:
MD2 Tutorial: http://tfc.duke.free.fr/old/models/md2.htm
Blender Tutorial: http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro, http://www.youtube.com/watch?v=gxSXp-vGyV8
Contra Reference: http://www.youtube.com/watch?v=kWMyoNhGHbk