DOC PREVIEW
MIT 6 111 - Design and Implementation of a 3-D Game

This preview shows page 1-2-3-4-5-6 out of 18 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Massachusetts Institute of TechnologyDepartment of Electrical Engineering and Computer Science6.111 - Introductory Digital Systems LaboratoryGary M. Matthias, Timothy M. Mwangi and Anthony J. QuiversMay 17, 2007Design and Implementation of a 3-D Gameof Pool on an FPGA Using the Major-Minor FSM SetupAbstract:In this project we use the major-minor finite state machine setup to implement a virtual form of the popular game, pool, using a field programmable gate array device. Specifically, we will obtain the position of a player around an empty pool table from the output of a NTSC video camera. Likewise, we will obtain the position of the tip of the pool stick and calculate the pivot angle based on colored reference points on both the pool table and the pool stick. Furthermore, the speed of the pool stick is calculated by digitizing the data from an accelerometer. On any particular shot, if the speed of the pool stick is greater than some threshold value, and the reference points of the pool table and the pool stick are within a specified distance, the shot will be extrapolated and the tip of the stick will strike the white ball. Any moving ball will strike balls in its path and the boundaries of the table according to the laws of motion in classical mechanics. The movement of each ball will be controlled by an identical minor FSM and a single major FSM will mediate collisions between the balls, table, edges and stick and apply the dissipative force of the pool table surface. A user who plays this game will be able to see the stick's position, relative to the pool table and the positions of the balls on the table on a screen in three-dimensions using ray tracing. Note however, that there are no physical balls and the player relies solely on the screen for information about the positions of different balls. We expect our solution to closely mimic a real game of pool. There are three main implementation and design challenges posed by this project. The first is using a camera to accurately determine the position and velocity of objects in its field of view. The second is creating a model of multiple collisions that is accurate, elegant and simple enough to be implemented using the major-minor FSM setup within the constraints of available resources. The third is to efficiently display the pool game in three dimensions with a relocatable point of observation, also within these resource constraints.Table of ContentsI. Introduction 1II. Camera and Accelerometer Input Module 21. NTSC Decoding 32. Pixel Receiver Module 33. Real Location Module 44. Color Threshold, Point Summation and Division Modules 45. Distance and Angle Calculation Module 56. ADC Input Module 57. Acceleration Peak Module 68. Speed Parametrizer Module 69. Testing the Inputs Module 6III. Pool Game Physics Simulation and Gaming Logic Console 71. General Overview 72. State Bus Implementation 93. Collision Management and Dynamics 104. System Performance and Results 12IV. Three-Dimensional Graphics Module 121. Introduction 122. EYE_PLANE_LINE Module 133. GET_BALL_INTERSECTION Module 134. GET_PLANE_INTERSECTION Module 145. CLOSEST Module 146. GET_CUBE_INTERSECTIONS Module 147. GET_CUE_INTERSECTION Module 158. GET_PLANES_INTERSECTIONS Module 159. GET_BALLS_INTERSECTION Module 1510. GET_INTERSECTIONS Module 1511. PIXEL_COLOR Module 1512. Testing and Debugging 16V. Conclusions 16Table of FiguresFigure 1: Pool Table as Seen from NTSC Video Camera 1Figure 2: Abstracted Block Diagram of Camera and Accelerometer Input Module 2Figure 3: Data Sequence of Video Encoded in NTSC 4:2:2 Format 3Figure 4: Ratio Between Postive x- and y-Components and Their Corresponding Angles 5Figure 5: Testing Interface for Inputs Module 6Figure 6: Pool Table Schematic 7Figure 7: Implementation of the Gaming and Logic Console 8Figure 8: Ball State Module 9Figure 9: Control Manager State Diagram 10Figure 10: Final Velocity Components 11Figure 11: Final Velocity Components and Implementation 11Figure 12: Block Diagram for Perspective Ray Tracing 13List of TablesTable 1: Threshold Values for Detecting Orange and Blue 4Table 2: Ball State Bus Implementation 9IntroductionThis project is an implementation of the two-player game of pool on the Xilinx 6.111 FPGA Labkit, a field programmable gate array device. It also makes use of an NTSC video camera, a DE-ACCM3D three-dimensional accelerometer from Dimension Engineering, an AD7810Y analog-to-digital converter from Analog Devices. The entire project can be broken up into three primary components: the input module, the gaming and physics module, and the display module. There is also a pool table, shown in Figure 1, in the physical world through which the user can input information.Figure 1: Pool Table as Seen from NTSC Video CameraThe video camera hangs directly above the pool table with a downward perspective. The pool table itself has a green color, whereas the center of the pool contains an orange, circular point-of-reference. The pool stick is brown and contains blue tip. The color-coded points of reference at the center of the pool table and at the tip of pool stick are used by the system to locate the relative locations of the two points by using chrominance and luminance thresholds and then calculating the center of mass. This color coding is necessary in order to simulate a pool ball strike. The relative points are used by the system to calculate the distance and the angle between the two points.The input module is the interface by which the user can input data into the system. This module employs the video camera data and the digitized accelerometer data. Using the information supplied by these devices the input module constantly calculates the center of mass of the orange point-of-reference in the center of the pool table and the blue point-of-reference on the tip of the pool stick. When the two points are close enough to each other, the input module sends an enable signal to the game and physics module to simulate a pool ball strike. At this point, the inputs module calculates the speed of the strike based on the information received from the analog-to-digital converter, and parametrizes this speed into x- and y-components, based on the angle between the two reference points. This module is important for integrating analog input into a digital environment.1The game and physics module is the module that carries out the movements of the pool balls. This module includes take into account


View Full Document

MIT 6 111 - Design and Implementation of a 3-D Game

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

Frogger

Frogger

11 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Design and Implementation of a 3-D Game
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Design and Implementation of a 3-D Game and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Design and Implementation of a 3-D Game 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?