Virtual Basketball: How Well Do You Shoot?

Virtual Basketball:
How Well Do You Shoot?
Chun Li & Jingwen Ouyang
6.111 Spring 2007
System Overview
velocity x 10
analog x
ADXL330
3-Axis
Accelerometer
10
analog y 10
velocity y 10
Calibration
&
Velocity
Calculation
analog z 10
velocity z
vga_colors 24
10
position x 10
Game Display
vsync, hsync,
hblank
position y 10
position z
Chun
10
Jingwen
Accelerometer & A/D Converter
•ADXL330 3-axis
Accelerometer
•±3g range
•Operating voltage 3V
•300 mV/g sensitivity
•AD7810 10-bit A/D
Converter
•Sample at 1 kHz
Velocity & Position Block Diagram
rel_y
20
rel_z
20
acc_x 10
vel_x
vel_y 20
Integrator
Integrator
reset
enable
acc_y 10
reset
Serial
Interface
enable
Integrator
height
switch[6:0]
7
sens_z
10
sens_y
10
Calibration
Serial
Interface
CONVST
DOUTX 10
SCLK
CONVST
DOUTY 10
SCLK
CONVST
DOUTZ 10
To all modules
Debounce
/Synchronize
sens_x 10
7
7
7
reset
To all modules
pos_x
pos_y
pos_z
clk
AD7810
vel_z 20
acc_z
reset
10
enable
SCLK
AD7810
Determine
Release
Velocities
20
Serial
Interface
analog_x
analog_y
analog_z
ADXL330
3-Axis Accelerometer
20
AD7810
rel_x
27Mhz_clock
Reset (button[0])
Calibration
• Obtain player height
• Calculate initial x, y, z positions
• Why: Variances
• 0g bias point
• sensitivity
Game Display Overview
Initial positions
10 x 3
labkit_clock
DCM
pixel_clock
Reset
Replay
Initial speeds
10 x 3
To All
reset_sync
Debouncer/
Synchronizer
replay_sync
Game Logic
Ball x, y, z
Positions
Shadow
Positions
10 x 3
10 x 3
pixel_count 10
VGA
Controller
line_count
1 x 4 VGA signals
10
Display Field
24 rgb_signal
Game Logic
Initial Positions
10 x 3
Initial speeds
10 x 3
Status
2
status
Get Ball position
10 x 3
ball_x,y,z
(FSM)
Get Shadow Position
10 x 3
Shadow_x,y,z
Calculations
• Speed
• Vz = g t + Vz (only vertical direction has acceleration)
*
t = time between each frame
• Position
• X = Vx
• Y = Vy
• X = Vz
t+X
t+Y
t+Z
• 3D to 2D conversion
• W = Z + X sin(a) – Y sin(b)
• U = X cos(a) + Y cos(b)
Display Field
10 x 3 ball_x,y,z
3D to 2D
ball_x,y
Converter
pixel_count 10
line_count
10 x 3
Address Counter
10
For ROM
7 ball_addr
ROM
2 color_index
Color Mapping
24 rgb_ball
24 x 4
RGB
Controller
rgb signals for the shadow, player,
scores, and background, which
are obtained similarly
24
rgb_signal
Game Display Interface (1)
+
+
+ 2
+ 4
+
Game Display Interface (2)
Conclusion
• practice shooting without a court
• Whenever
• Game for the Wii