Ludo Report
Ludo Report
CHAPTER 1
INTRODUCTION
Although early application in engineering & science had to rely on expensive &
cumbersome equipments, advances in computer technology have made interactive computer
graphics a practical tool.
Now it can be answered about computer graphics as generalized tool for drawing and
creating pictures and simulates the real world situations within a small computer window.
1.2 History
William fetter was credited with coning the term Computer Graphics in 1960, to
describe his work at Boeng. One of the first displays of computer animation was future world
(1976), which included an animation of a human face and hand-produced by Carmull and
Fred Parkle at the University of Utah.
There are several international conferences and journals where the most significant
results in computer-graphics are published. Among them are the SIGGRAPH and Euro
graphics conferences and the association for computing machinery (ACM) transaction on
Graphics journals.
LUDO-BOARD GAME
Nowadays Computer Graphics used in almost all the areas ranges from science,
engineering, medicine, business, industry, government, art, entertainment, education and
training.
Computer Aided Design methods are routinely used in the design of buildings,
automobiles, aircraft, watercraft, spacecraft computers, textiles and many other applications.
Another major application area presentation graphics used to produce illustrations for
reports or generate slides. Presentation graphics is commonly used to summarize financial,
statistical, mathematical, scientific data for research reports and other types of reports.2D and
3D bar chart to illustrate some mathematical or statistical report.
CG methods are widely used in both fine art and commercial art applications. Artists
use a variety of computer methods including special purpose hardware, artist’s paintbrush
program (lumena), other pain packages, desktop packages, maths packages, animation
packages that provide facility for designing object motion. Ex: cartoons design is an example
of computer art which uses CG.
1.3.4 Entertainment
Computer graphics methods are now commonly used in making motion pictures,
music, videos, games and sounds. Sometimes graphics objects are combined with the actors
and live scenes.
Although the methods used in CG image processing overlap, the 2 areas are
concerned with fundamentally different operations. In CG a computer is used to create
picture. Image processing on the other hand applies techniques to modify existing pictures
such as photo scans, TV scans.
It’s a computer version of the simple board game usually play in daily life. About the
dice rolling, coins moving as per the numbers indicated by the dice. Whoever first reaches
all his coins on to HOME area is the winner. Here the implementation is done for a version
of 2 players and 2 coins.
1.5 Objectives
Introduction to OpenGL
LUDO-BOARD GAME
Most of the application will be designed to access OpenGL directly through functions
in three libraries. Functions in the main GL (or OpenGL in windows) library have names that
begin with the letters gl and are stored in a library usually referred to as GL (or OpenGL in
windows). The second is the OpenGL Utility Library (GLU). This library uses only GL
functions but contains code for creating common objects and simplifying viewing. All
functions in GLU can be created from the core GL library but application programmers prefer
not to write the code repeatedly. The GLU library is available in all OpenGL
implementations; functions in the GLU library begin with letters glu.
To interface with the window system and to get input from external devices into the
programs, need at least one more system-specific library that provides the “glue” between the
window system and OpenGL. For the X window system, this library is functionality that
should be expected in any modern windowing system.
Fig 2.1 shows the organization of the libraries for an X Window System environment.
For this window system, GLUT will use GLX and the X libraries. The application program,
however, can use only GLUT functions and thus can be recompiled with the GLUT library
for other window systems.
GLU
GL Frame
OpenGL Buffer
application Xlib, Xtk
Program
GLUT
GLX
CHAPTER 2
At the start of the game, the player's four pieces are placed in the start area of their
colour.
Players take it in turn to throw a single die. A player must first throw a six to be able
to move a piece from the starting area onto the starting square.
In each subsequent turn the player moves a piece forward 1 to 6 squares as indicated
by the die.
When a player throws a 6 the player may bring a new piece onto the starting square,
or may choose to move a piece already in play. Any throw of a six results in another
turn.
If a player cannot make a valid move they must pass the die to the next player.
If a player's piece lands on a square containing an opponent's piece, the opponent's
piece is captured and returns to the starting area.
A piece may not land on a square that already contains a piece of the same colour
(unless playing doubling rules).
Once a piece has completed a circuit of the board it moves up the home column of its
own colour. The player must throw the exact number to advance to the home square.
The winner is the first player to get all four of their pieces onto the home square.
A ludo board is normally a square marked with a cross. Each arm of the cross is
divided into three columns, with the columns divided into usually six squares.
The centre of the cross is the finishing square which is often divided into four colored
triangles. Each colored triangle is combined with a colored middle column appears as
an arrow pointing to the finish.
LUDO-BOARD GAME
The shaft of each arrow is a player's "home column" and is five squares long. To the
left of each home column, one square from the edge of the board is a starting square,
also colored.
During game play a piece moves from its starting square, clockwise around the
perimeter of the board, and up the player's home column to the finishing square.
In the space to the left of each arm is a circle or square to hold a player's pieces
before they are allowed into play. There are no resting squares, but the colored home
column may only be entered by its own player's tokens.
The special areas on the board are typically brightly colored with yellow, green, red,
and blue. Each player uses cardboard or plastic tokens of matching color.
CHAPTER 3
LUDO-BOARD GAME
Initiates a new primitive of type mode and starts the collection of vertices. Values of
mode include GL_POINTS, GL_LINES and GL_POLYGON.
Sets the present RGB colors. Valid types are int ( i ), float ( f ) and double ( d ). The
maximum and minimum values of the floating-point types are 1.0 and 0.0,
respectively.
Sets the present RGBA clear color used when clearing the color buffer. Variables of
GLclampf are floating-point numbers between 0.0 and 1.0.
Creates a window on the display. The string title can be used to label the window. The
return value provides a reference to the window that can be used where there are
multiple windows.
Specifies the initial position of the top-left corner of the window in pixels.
Request a display with the properties in mode. The value of mode is determined by
the logical OR of operation including the color model (GLUT_RGB, GLUT_INDEX)
and buffering (GLUT_SINGLE, GLUT_DOUBLE);
Initializes GLUT. The arguments from main are passed in and can be used by the
application.
Cause the program to enter an event processing loop. It should be the last statement in
main.
Registers the display function func that is executed when the window needs to be
redrawn.
Renders the character with ASCII code char at the current raster position using the
raster font given by font. Fonts include GLUT_BITMAP_TIMES_ROMAN_10 and
GLUT_BITMAP_TIMES_ROMAN_8_Y_13. The raster position is incremented by
the width of the character.
LUDO-BOARD GAME
Passing control to
Pushes to and pops from the matrix stack corresponding to current matrix mode.
Hardware Requirements:
Software Requirement:
CHECK_COND ();
Checking condition for 2 players and initializing there corresponding position. At the
win condition DRAW(); PLY1WIN(); PLY2WIN(); functions are called to end the game
and restart.
DICE ();
DISPLAY ();
Display’s board, coins position and moves the coin of the player as per the condition
checked in CHECK_COND(); function, changing the chances from player 1 to player
2 alternatively. Displays the game playing instructions and rules of playing game.
Capturing of the one player coin to the other player coin and return the hit coin to the
start position. The capturing coin can enter the home column. The player moving all
his coins through this home region is considered the winner. If none of the player
coins are hit then the game is drawn.
MYMOUSE ();
Select’s the players coin, roll the dice for the player, increments the coins position of
the selected players coin. Traversing from one screen of detail to other, Restart of the
game. The control is passed to the DISPLAY(); function sending the selected coin
data which result in the traversing and display of that particular coin.
The game moves are explained in the flow charts. Explaining the step by step
execution of main and game play.
LUDO-BOARD GAME
Start
Mouse func or
key func
If( bt
==LEF
n or T Roll the dice & Move coin A
key)
==RIG
HT
Show menu options
==‘q’||’
Q’ Exit(0);
Fig 3.1: Flow chart for main()
LUDO-BOARD GAME
A
Dice value is 6 0r 1 B
Move coin outside or
change its positi
If its pos =
Dice
opponent posye
=6 Roll the
s
dice
rep
eat
n Hit
oppon
o ent Return opponent to
ye
initial & play again
s
al
o
g
Change
player B Enter
Home
3.5 RESULTS
CHAPTER 4
4.1 CONCLUSION
The new interactive way of playing this game on the computer is displayed.
The demo is made more interactive with a keyboard and mouse interaction module in
the program.
Even though demo designed is enriched with many options, it is a two dimensional
demo, in future it can be re designed with 3D animation and sound effects.
By using this demo further for four coins and four players can be implemented.
LUDO-BOARD GAME
REFERENCES
I. Edward Angel-Interactive Computer Graphics: A Top-Down Approach using
OpenGL Fifth Edition, Published by Pearson Education, 2009
II. The OpenGL Programming Guide, 5th Edition. The Official guide to learning OpenGL
Version 2.1 by OpenGL Architecture Review Board.
III. en.wikipedia.org/ludo_board_game.html