CS360: COMPUTER GRAPHICS COURSE PROJECT ...SNOOKER A cue sport played on a table with 6 pockets...

Preview:

Citation preview

SCENIC SNOOKERCS360: COMPUTER GRAPHICS COURSE PROJECT

Ayush Kumar (170195)Author:

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.

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)

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

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

POOLTABLE MODEL

POOLTABLE TEXTURED

BALLS AND CUESTICK

ADDING ENVIRONMENT

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

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

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.

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

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

QUEST IONS?

Recommended