Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows Programming Term Project 李天行 B84506024 鍾碩恒 B84506003 Special Help From: 劉正芸 B84701226.

Similar presentations


Presentation on theme: "Windows Programming Term Project 李天行 B84506024 鍾碩恒 B84506003 Special Help From: 劉正芸 B84701226."— Presentation transcript:

1 Windows Programming Term Project 李天行 B84506024 鍾碩恒 B84506003 Special Help From: 劉正芸 B84701226

2 Game Outline Simulation of Future Space Combat in a 3D Universe. As a dauntless pilot of the Federation, you will be engaging an infinite number of mostly Tie-like enemy fighters. With limited fuel and missiles, take down as many as your skills allow. Amazingly detailed spaceships, dazzling explosions, breathtaking sound effect, intense dog-fights against enemy fighters. Looks and performs the greatest with P3 processor.

3 Crafts Action Mechanism(1/2) Basic info of the crafts: –current position and speed in the 3D space –current rotation matrix of the craft (pre- multiplied matrix) Flying: –Rotate the space craft, situate the craft at the position in the space, and move the craft toward the Y-Axis of the craft’s local coordinate.

4 Crafts Action Mechanism(2/2) Rotating: –Construct a new rotation matrix according to the current rotating, and pre-multiply it with the recorded rotation matrix of previous actions.

5 Enemy AI (1/3) Inherit Craft Action Mechanism Enemy Status: –Drifting Flying straight. –Escaping According to his position in our local coordinate, it tries to turn to a direction to escape from our view. Change to the Drifting state once turned. ( If being chased by a missile, escape the missile with the same mechanism as stated above)

6 Enemy AI (2/3) –Chasing According to our position in his local coordinate, it tries to turn to a direction to have us in its view. Once we are in his available attacking range, it fires at us.

7 Enemy AI (3/3) Enemy’s Decision Making Mechanism: Chasing Attack EscapingThinking Drifting If no escape If need to escape expires permits

8 Pilot Action Mechanism Inherit Craft Action Mechanism Change the view point of pilot according to: –The position of the pilot –The Y-Axis and Z-Axis direction implied in the rotation matrix.

9 Explosion We use texture mapping and blending function to simulate explosion. Texture Mapping Simulate the flame of the explosion. Blending Function Simulate the translucent effect of flame.

10 Cockpit(1) First, use CreatePolygonRgn to create the shape of the cockpit. Then, use SetWindowRgn to make the window become the shape we just created.

11 Cockpit(2) X-Y Radar X-Z Radar Radar Ratio Enemy information Missile number Speed Blood Gas

12 Music and Sound Effect We use MIDI for Background Music, and WAVE for sound effect like explosion, fire …etc.

13 Collision Test (1/2) Hit by laser gun: –laser beam was made by several rectangles lined up in front of the pilot’s view. When any of the triangles of the aircraft that overlapped the rectangles, it was hit. Otherwise, the aircraft left intact. Method: –OpenGL provides a mechanism that automatically tells you which objects are drawn inside the a specific volume of the space.

14 Collision Test (2/2) Selection: –Draw the scene into the framebuffer, and then enter selection mode and redraw the scene. When it exits selection mode, OpenGL returns a list of the primitives that intersect the viewing volume. Each primitive that intersects the volume causes a selection hit. The hit records correspond to the current contents of the name stack which is constructed by loading names onto it as issuing primitive drawing commands while in selection mode.

15 Stars of the Universe Generate an infinite sky of stars: –Only the area surrounded the pilot is rendered. –Generate a block of area with white and orange dots as stars randomly. Then copy this block 27 times and put those identical blocks as a cube which 3 blocks at each side. The current position of pilot is always in the center of the cube. –When pilot flies over the boundary of the center block, replace the 3 blocks from back to front along the direction ahead of the pilot.

16 Reference: Programming Windows 5th Edition ~Charles Petzold OpenGL Programming Guide 2nd Edition ~Mason Woo, Jackie Neider,Tom Davis


Download ppt "Windows Programming Term Project 李天行 B84506024 鍾碩恒 B84506003 Special Help From: 劉正芸 B84701226."

Similar presentations


Ads by Google