CPE 471 Final Project: 3D Checkers
Zachary Winger
Spring 2019

Description

For my final project I decided to make a 3D game of checkers. The game camera is placed on the top hemisphere of a sphere that is centered on the orign, which provides for a smooth way for the scene to transition around the game board. The user is also able to look around the scene by clicking and dragging the mouse around the screen. The camera can also be moved by the user using the WASD keys, but will also automatically transition to the side of the board the opposing player is on when the turn changes. Players are only able to select their own pieces, and further can only select pieces that can result be moved legally. Also, once a piece is selected, the player must move that piece, there is no changing their mind once it is selected. Once a piece reaches the side opposite its starting position, it will gain a rider and become a king, and be able to move like one would in a normal game of checkers. When this action occurs, an explosion of golden particles will be spawned at the location of the game piece. To select a piece and tile to move to, the user will move a tile around the board that will be colored either green or red based on the legality of the tile. If the user is selecting a piece, only tiles with their pieces that can be moved legally will appear green, all other tiles will appear red when the cursor is over them. When the user is choosing a tile to move a piece to, only tiles the piece can legally move to will show up as green when the cursor is over them When a piece is jumped, it will spawn an explosion of particles at the same location as the piece and will be the color of the piece that was jumped.


Controls

  • WASD to move the camera up, left, down, and right
  • The arrow keys will move the selecting tile around the board to select a piece to move or to select a tile to move a piece to
  • Clicking and dragging the mouse will look around the scene
  • R will reset the game to its original state
  • If a the tile cursor is under a piece and the piece belongs to the player whose turn it is, it will turn the piece into a king
  • Features

  • Heirarchical modeling
  • Blinn-Phong shading
  • Textures
  • Collision detection
  • Particle effects
  • Modified Virtual Game Camera
  • Hierarchical Modeling

    Hierarchical modeling was used to create the game pieces. They were made by using non-uniformly scaled sphere models. They aniamtion is achieved by rotating the spheres around pivot points that were chosen to represent the joints of the models. When a piece becomes a king, it gains a rider, which is also hierarchically modeled and animated in the same way as the base pieces. The people sitting on the benches are also hierarchically modeled and animated similar to the game pieces.




    Blinn-Phong Shading

    Blinn-Phong shading was used to add more realistic shading to the models in the scene. The colors of the pieces and players were based on the school colors of Cal Poly, green and gold, and USC, red and gold. The position of the light I chose to use was the position of the camera. So, when the camera rotates around the scene, so does the light which gives a nice uniform lighting to the scene.

    Textures

    Textures were used in the scene to make some models look more realistic than was possible with only the Blinn-Phong shading. The benches in the scene have a texture on them that give them a more realistic wooden look. Textures were also used on the dogs in the scene that sit on top of the rocks at the corners of the board. Textures were also used with a cube map to make the skybox for the scene. Doing so allows the scene to look as though it is taking place somewhere outside of a void, which adds to the realistic look.


    bench

    dog

    skybox

    Collision Detection and Particle Effects

    Collision detection was used to determine if any of the game pieces jumped an opponent's piece when they moved to their target destination. To determine when a collision occured, I made bounding spheres for all of the pieces and checked if the distance between any two spheres was less than the sum of their radii. When a collision is detected, the piece that is being jumped is removed from the game and a explosion of particles spawns in its place. Particle effects are also spawned when a piece legally becomes a king by getting to the side of the board opposite its original starting position.


    Gamer Camera

    The camera used in the scene is a modified virtual game camera. It does not have full freedom to explore the world, but can still look all around the scene, and move around the board at the center. The camera is situated on the top hemisphere that is centered at the orign, and is restircted to not be able to move below the ground, and cannot go past the vertical axis through the origin. When moving the camera left, right, up, or down, it moves along the hemisphere in a clockwise or counterclockwise motion depending on the way the user is wanting to move. The camera moves in this way to be able to create a smooth transition when the player turns change and the camera needs to move around the board to give a view from the other player's perspective.


    Resources

  • Skybox tutorial
  • Cube maps for skyboxes
  • Obj files for download
  • Materials for shading
  • Lab 10: Particles for particle effects
  • Lab 9: Boids for collision detection
  • Lab 8: Pitch and Yaw Camera and Skybox for the virtual camera and skybox
  • Class Notes