15
SCENIC SNOOKER CS360: COMPUTER GRAPHICS COURSE PROJECT Ayush Kumar (170195) Author:

CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

SCENIC SNOOKERCS360: COMPUTER GRAPHICS COURSE PROJECT

Ayush Kumar (170195)Author:

Page 2: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

SNOOKER

▸ A cue sport played on a table with 6 pockets along the rails.

▸ Several variations of this game with their own names. 8-Ball, Black-Ball, 9-Ball, Blank Ball and many more…

▸ We have built an 8-ball pool. This consists of 7 balls each of solids and stripes and a black ball.

▸ Players take alternate turns. The first person to pocket all designated balls followed by black wins.

Page 3: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

GAME SCENE

▸ Consists of the following objects:

▸ Fixed PoolTable with wooden texture

▸ Rigid spherical balls with 15 different textures

▸ Rigid Cuestick with darkwood texture

▸ Camera (Viewpoint) with a fixed trajectory

▸ Aim and Bounding Boxes

▸ Environment (Cubemap)

Page 4: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

OBJECT LOADER

▸ Pooltable, textures and Environment Map was obtained from an open-source model and texture library

▸ All remaining object were modelled in Blender.

▸ An object loader was written to load vertex data from wavefront files (.obj)

▸ pooltable.obj

▸ ball.obj

▸ cuestick.obj

Page 5: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

SHADERS

▸ Blinn-Phong Lighting Model was implemented

▸ Fixed Point Lights and Directional Lights were used

▸ Used diffuse and specular maps for each object

▸ ball_diffuse.fs ball_diffuse.vs

▸ pooltable_diffuse.fs pooltable_diffuse.vs

▸ cubemap.fs cubemap.vs

Page 6: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

POOLTABLE MODEL

Page 7: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

POOLTABLE TEXTURED

Page 8: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

BALLS AND CUESTICK

Page 9: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

ADDING ENVIRONMENT

Page 10: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

Decide turn: Player 1?

GAME LOOP

Render Initial Scene

Game Over?

Move Camera To position Aim Lock Camera

Unlock Camera

Hold and Drag To adjust Power

ESC key

Update Gamestate

A,W,S,D, Mouse movement

Exit

Render Gamestate

Is simulation complete?

Update Score

Release mouse

Initialize simula- tion variables

Is turn complete?No

Yes

Yes

NoYes

No

Page 11: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

CUBEMAPS

▸ A technique for environment mapping where the environment is projected onto the 6 faces of a cube

▸ The cube is always located at the Camera (camera transformations are applied) which gives the feel that the environment is infinitely large

▸ A distant point in the environment is assigned the pixel value corresponding to the point where the ray intersects the cube

Page 12: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

GAMEPLAY

▸ Each player gets turns alternatively. The player can move the camera along the rails of the pooltable which changes the aim vector.

▸ Camera movement is controlled using A,W,S,D keys and mouse movement.

▸ After aiming, player locks the camera and holds and drags the mouse to adjust power of the shot, releases to shoot.

Page 13: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

FRAMEWORKS / LIBRARIES

▸ OpenGL 4.0

▸ GLEW: library for querying and loading OpenGL functions at runtime.

▸ GLFW: Library for window management and input processing.

▸ glm: Library for performing efficient matrix computations

▸ ReactPhysics3D: Library for performing rigid n-body collisions

Page 14: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

PROJECT FILES

‣ Makefile ‣ main.cpp ‣ Headers/

‣ Abstractobject.h ‣ App.h ‣ Ball.h ‣ camera.h ‣ Cuestick.h ‣ Environment.h ‣ Font.h ‣ Gamestate.h ‣ glm_includes.h ‣ objloader.h ‣ opengl_includes.h ‣ Pooltable.h ‣ shader.h ‣ texture.h

‣ Sources/ ‣ Abstractobject.cpp ‣ App.cpp ‣ Ball.cpp ‣ Cuestick.cpp ‣ Environment.cpp ‣ Font.cpp ‣ Gamestate.cpp ‣ objloader.cpp ‣ Pooltable.cpp ‣ shader.cpp ‣ texture.cpp

‣ shaders/ ‣ axes.fs ‣ axes.vs ‣ ball_diffuse.fs ‣ ball_diffuse.vs ‣ cubemap.fs ‣ cubemap.vs ‣ pooltable_diffuse.fs ‣ pooltable_diffsue.vs ‣ text.fs ‣ text.vs

‣ models/ ‣ ball.obj ‣ ball.mtl ‣ cuestick.obj ‣ cuestick.mtl ‣ pooltable.obj ‣ pooltable.mtl ‣ textures/

‣ skyboxes/ ‣ stb_image/

‣ stb_image.h

‣ Github repository: https://github.com/ayush194/Snooker

Page 15: CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets along the rails. Several variations of this game with their own names. 8-Ball, Black-Ball,

QUEST IONS?