SlideShare a Scribd company logo
#include <gl//glut.h>
//#include<math.h>
void init ()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glPointSize(5.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//setting the resolution for the 2D object
gluOrtho2D(0.0,300.0, 0.0, 300.0); //void gluOrtho2D(left,r,bot,top);
//gluOrtho2D sets up a two-dimensional orthographic viewing region.
//equivalent to calling glOrtho with near = -1 and far = 1 .
//void glOrtho(left,right,bottom,top,nearVal,farVal);
}
void CheckerBoard()
{
glPointSize(5.0);
//
int x1,y1;
x1=0;
y1=500;
for(int i=1;i<=8;i++)
{
x1=x1+50;
y1=500;
for(int j=1;j<=8;j++)
{
y1=y1-50;
glBegin(GL_QUADS);
if(i%2 != 0 )
{
if( j%2 != 0 )
{
//glColor3f(1.0,1.0,1.0); //white
glColor3f(202.0/255.00, 169.0/255.0,
106.0/255.0);//orange
glVertex3f(x1,y1,0);
glVertex3f(x1+50,y1,0);
glVertex3f(x1+50,y1-50,0);
glVertex3f(x1,y1-50,0);
}
else
{
glColor3f(146.0/255.0, 140.0/255.0,
168.0/255.0);//brown
//glColor3f(0.0,0.0,0.0); //black
glVertex3f(x1,y1,0);
glVertex3f(x1+50,y1,0);
glVertex3f(x1+50,y1-50,0);
glVertex3f(x1,y1-50,0);
}
}
else{
if(j%2 != 0)
{
glColor3f(146.0/255.0, 140.0/255.0,
168.0/255.0);
//glColor3f(0.0,0.0,0.0);
glVertex3f(x1,y1,0);
glVertex3f(x1+50,y1,0);
glVertex3f(x1+50,y1-50,0);
glVertex3f(x1,y1-50,0);
}
else{
glColor3f(202.0/255.00, 169.0/255.0,
106.0/255.0);
// glColor3f(1.0,1.0,1.0);
glVertex3f(x1,y1,0);
glVertex3f(x1+50,y1,0);
glVertex3f(x1+50,y1-50,0);
glVertex3f(x1,y1-50,0);
}
}
glEnd();
}
}
}
void Display()
{
glClear(GL_COLOR_BUFFER_BIT);
//calling
CheckerBoard();
glFlush ();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (900, 450);
glutInitWindowPosition (100, 100);
glutCreateWindow ("Assignment: Lab 2");
init ();
glutDisplayFunc(Display);
glutMainLoop();
}

More Related Content

What's hot

computer graphics at openGL (2)
computer graphics at openGL (2)computer graphics at openGL (2)
computer graphics at openGL (2)
Yasir Khan
 
HelsinkiOS Jan 2015: Useful iOS Code Snippets
HelsinkiOS Jan 2015: Useful iOS Code SnippetsHelsinkiOS Jan 2015: Useful iOS Code Snippets
HelsinkiOS Jan 2015: Useful iOS Code Snippets
Jouni Miettunen
 
Barcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kóduBarcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kóduMilos Lenoch
 
Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Recoil at Codete Webinars #3
Recoil at Codete Webinars #3
Mateusz Bryła
 
Having fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.jsHaving fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.js
Michael Hackstein
 
Ios13 bluetooth-dualshock4
Ios13 bluetooth-dualshock4Ios13 bluetooth-dualshock4
Ios13 bluetooth-dualshock4
harumidiv
 
Computer lab (programs)
Computer lab (programs)Computer lab (programs)
Computer lab (programs)
mshoaib15
 
Seeking the truth from mobile analytics
Seeking the truth from mobile analyticsSeeking the truth from mobile analytics
Seeking the truth from mobile analytics
Mouhcine El Amine
 
Paperjs presentation
Paperjs presentationPaperjs presentation
Paperjs presentationsharp-blade
 
ORM is an Offensive Anti-Pattern
ORM is an Offensive Anti-PatternORM is an Offensive Anti-Pattern
ORM is an Offensive Anti-Pattern
Yegor Bugayenko
 
Human-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy BearsHuman-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy BearsRui Lopes
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
Junha Jang
 
Ruby haskell extension
Ruby haskell extensionRuby haskell extension
Ruby haskell extension
Toshiyuki Terashita
 
7. chapter vi
7. chapter vi7. chapter vi
7. chapter vi
Chhom Karath
 

What's hot (18)

computer graphics at openGL (2)
computer graphics at openGL (2)computer graphics at openGL (2)
computer graphics at openGL (2)
 
135
135135
135
 
HelsinkiOS Jan 2015: Useful iOS Code Snippets
HelsinkiOS Jan 2015: Useful iOS Code SnippetsHelsinkiOS Jan 2015: Useful iOS Code Snippets
HelsinkiOS Jan 2015: Useful iOS Code Snippets
 
Barcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kóduBarcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kódu
 
cosc 281 hw2
cosc 281 hw2cosc 281 hw2
cosc 281 hw2
 
Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Recoil at Codete Webinars #3
Recoil at Codete Webinars #3
 
Having fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.jsHaving fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.js
 
Ios13 bluetooth-dualshock4
Ios13 bluetooth-dualshock4Ios13 bluetooth-dualshock4
Ios13 bluetooth-dualshock4
 
Computer lab (programs)
Computer lab (programs)Computer lab (programs)
Computer lab (programs)
 
Seeking the truth from mobile analytics
Seeking the truth from mobile analyticsSeeking the truth from mobile analytics
Seeking the truth from mobile analytics
 
Paperjs presentation
Paperjs presentationPaperjs presentation
Paperjs presentation
 
ORM is an Offensive Anti-Pattern
ORM is an Offensive Anti-PatternORM is an Offensive Anti-Pattern
ORM is an Offensive Anti-Pattern
 
Human-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy BearsHuman-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy Bears
 
C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시C언어 스터디 강의자료 - 1차시
C언어 스터디 강의자료 - 1차시
 
Drawing Figures
Drawing FiguresDrawing Figures
Drawing Figures
 
Ruby haskell extension
Ruby haskell extensionRuby haskell extension
Ruby haskell extension
 
Structure
StructureStructure
Structure
 
7. chapter vi
7. chapter vi7. chapter vi
7. chapter vi
 

Viewers also liked

An inquiry based project for stem
An inquiry based project for stemAn inquiry based project for stem
An inquiry based project for stem
Laura Bradford
 
Una giornata a pentedattilo
Una giornata a pentedattiloUna giornata a pentedattilo
Una giornata a pentedattiloardimaco
 
Fracturas tipos
Fracturas tiposFracturas tipos
Fracturas tipos
gabriella00
 
Gif and images
Gif and imagesGif and images
Gif and imagesmacraildr
 
Proyecto de las tic
Proyecto de las ticProyecto de las tic
Proyecto de las tic
Marcela Perez
 
fgcu_fpra_internship_fair_2014_division_d_category_5_entry
fgcu_fpra_internship_fair_2014_division_d_category_5_entryfgcu_fpra_internship_fair_2014_division_d_category_5_entry
fgcu_fpra_internship_fair_2014_division_d_category_5_entryMolly Nurczyk
 
Tecnotaaller
TecnotaallerTecnotaaller
Tecnotaallertali44
 
Redes de área local
Redes de área localRedes de área local
Redes de área local
lilian87
 
Ultimo formato magola
Ultimo formato magolaUltimo formato magola
Ultimo formato magola
magola1
 
highly effective teens
highly effective teenshighly effective teens
highly effective teens
Deon Kristiawan
 
Departamentos de córdoba tobias
Departamentos de córdoba tobiasDepartamentos de córdoba tobias
Departamentos de córdoba tobiasinformaticasanjose
 
Konsep tata ruang benua maritim
Konsep tata ruang benua maritimKonsep tata ruang benua maritim
Konsep tata ruang benua maritim
Kellin Quinn
 
EMI Style Usage Troubleshooting Guide
EMI Style Usage Troubleshooting GuideEMI Style Usage Troubleshooting Guide
EMI Style Usage Troubleshooting GuideMIKO ..
 

Viewers also liked (18)

An inquiry based project for stem
An inquiry based project for stemAn inquiry based project for stem
An inquiry based project for stem
 
Una giornata a pentedattilo
Una giornata a pentedattiloUna giornata a pentedattilo
Una giornata a pentedattilo
 
Fracturas tipos
Fracturas tiposFracturas tipos
Fracturas tipos
 
ร้องกวาง
ร้องกวางร้องกวาง
ร้องกวาง
 
ลอง
ลองลอง
ลอง
 
Gif and images
Gif and imagesGif and images
Gif and images
 
Proyecto de las tic
Proyecto de las ticProyecto de las tic
Proyecto de las tic
 
เมืองแพร่
เมืองแพร่เมืองแพร่
เมืองแพร่
 
Turner Resume
Turner ResumeTurner Resume
Turner Resume
 
fgcu_fpra_internship_fair_2014_division_d_category_5_entry
fgcu_fpra_internship_fair_2014_division_d_category_5_entryfgcu_fpra_internship_fair_2014_division_d_category_5_entry
fgcu_fpra_internship_fair_2014_division_d_category_5_entry
 
Tecnotaaller
TecnotaallerTecnotaaller
Tecnotaaller
 
Redes de área local
Redes de área localRedes de área local
Redes de área local
 
Ultimo formato magola
Ultimo formato magolaUltimo formato magola
Ultimo formato magola
 
highly effective teens
highly effective teenshighly effective teens
highly effective teens
 
Departamentos de córdoba tobias
Departamentos de córdoba tobiasDepartamentos de córdoba tobias
Departamentos de córdoba tobias
 
Konsep tata ruang benua maritim
Konsep tata ruang benua maritimKonsep tata ruang benua maritim
Konsep tata ruang benua maritim
 
เด่นชัย
เด่นชัยเด่นชัย
เด่นชัย
 
EMI Style Usage Troubleshooting Guide
EMI Style Usage Troubleshooting GuideEMI Style Usage Troubleshooting Guide
EMI Style Usage Troubleshooting Guide
 

Similar to Ass day2 1_checkerboard...copy in cpp

Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
Aila Gema Safitri
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
Bijoy679
 
animation.#include windows.h#include GLglut.h#inclu.pdf
animation.#include windows.h#include GLglut.h#inclu.pdfanimation.#include windows.h#include GLglut.h#inclu.pdf
animation.#include windows.h#include GLglut.h#inclu.pdf
ambritgames
 
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)
Robi Parvez
 
Programa de objetos 3 d wire
Programa de objetos 3 d wirePrograma de objetos 3 d wire
Programa de objetos 3 d wireRené Domínguez
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
Gulnaz Akhter
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
Gulnaz Akhter
 
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
ajoy21
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
Jannat Jamshed
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
Jannat Jamshed
 
computer graphics at openGL
computer graphics at openGLcomputer graphics at openGL
computer graphics at openGL
Yasir Khan
 
FLTK Summer Course - Part VIII - Eighth Impact - Exercises
FLTK Summer Course - Part VIII - Eighth Impact - ExercisesFLTK Summer Course - Part VIII - Eighth Impact - Exercises
FLTK Summer Course - Part VIII - Eighth Impact - Exercises
Michel Alves
 
The Ring programming language version 1.5.2 book - Part 54 of 181
The Ring programming language version 1.5.2 book - Part 54 of 181The Ring programming language version 1.5.2 book - Part 54 of 181
The Ring programming language version 1.5.2 book - Part 54 of 181
Mahmoud Samir Fayed
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
Gulnaz Akhter
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
Gulnaz Akhter
 
The Ring programming language version 1.6 book - Part 57 of 189
The Ring programming language version 1.6 book - Part 57 of 189The Ring programming language version 1.6 book - Part 57 of 189
The Ring programming language version 1.6 book - Part 57 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184
Mahmoud Samir Fayed
 
Ass day3 1_bd flag
Ass day3 1_bd flagAss day3 1_bd flag
Ass day3 1_bd flagRobi Parvez
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
EngrZamaan
 

Similar to Ass day2 1_checkerboard...copy in cpp (20)

Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
 
animation.#include windows.h#include GLglut.h#inclu.pdf
animation.#include windows.h#include GLglut.h#inclu.pdfanimation.#include windows.h#include GLglut.h#inclu.pdf
animation.#include windows.h#include GLglut.h#inclu.pdf
 
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)
 
Programa de objetos 3 d wire
Programa de objetos 3 d wirePrograma de objetos 3 d wire
Programa de objetos 3 d wire
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
#includefloat angle, move, scene, roadmove,turn, on=1; int i, st.docx
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
 
Practica
PracticaPractica
Practica
 
computer graphics at openGL
computer graphics at openGLcomputer graphics at openGL
computer graphics at openGL
 
FLTK Summer Course - Part VIII - Eighth Impact - Exercises
FLTK Summer Course - Part VIII - Eighth Impact - ExercisesFLTK Summer Course - Part VIII - Eighth Impact - Exercises
FLTK Summer Course - Part VIII - Eighth Impact - Exercises
 
The Ring programming language version 1.5.2 book - Part 54 of 181
The Ring programming language version 1.5.2 book - Part 54 of 181The Ring programming language version 1.5.2 book - Part 54 of 181
The Ring programming language version 1.5.2 book - Part 54 of 181
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
The Ring programming language version 1.6 book - Part 57 of 189
The Ring programming language version 1.6 book - Part 57 of 189The Ring programming language version 1.6 book - Part 57 of 189
The Ring programming language version 1.6 book - Part 57 of 189
 
The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184The Ring programming language version 1.5.3 book - Part 65 of 184
The Ring programming language version 1.5.3 book - Part 65 of 184
 
Ass day3 1_bd flag
Ass day3 1_bd flagAss day3 1_bd flag
Ass day3 1_bd flag
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
 

Recently uploaded

Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 

Ass day2 1_checkerboard...copy in cpp

  • 1. #include <gl//glut.h> //#include<math.h> void init () { glClearColor(0.0, 0.0, 0.0, 0.0); glPointSize(5.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); //setting the resolution for the 2D object gluOrtho2D(0.0,300.0, 0.0, 300.0); //void gluOrtho2D(left,r,bot,top); //gluOrtho2D sets up a two-dimensional orthographic viewing region. //equivalent to calling glOrtho with near = -1 and far = 1 . //void glOrtho(left,right,bottom,top,nearVal,farVal); } void CheckerBoard() { glPointSize(5.0); // int x1,y1; x1=0; y1=500; for(int i=1;i<=8;i++) { x1=x1+50; y1=500; for(int j=1;j<=8;j++) { y1=y1-50; glBegin(GL_QUADS); if(i%2 != 0 ) { if( j%2 != 0 ) { //glColor3f(1.0,1.0,1.0); //white glColor3f(202.0/255.00, 169.0/255.0, 106.0/255.0);//orange glVertex3f(x1,y1,0); glVertex3f(x1+50,y1,0); glVertex3f(x1+50,y1-50,0); glVertex3f(x1,y1-50,0); } else { glColor3f(146.0/255.0, 140.0/255.0, 168.0/255.0);//brown //glColor3f(0.0,0.0,0.0); //black glVertex3f(x1,y1,0); glVertex3f(x1+50,y1,0); glVertex3f(x1+50,y1-50,0); glVertex3f(x1,y1-50,0); } }
  • 2. else{ if(j%2 != 0) { glColor3f(146.0/255.0, 140.0/255.0, 168.0/255.0); //glColor3f(0.0,0.0,0.0); glVertex3f(x1,y1,0); glVertex3f(x1+50,y1,0); glVertex3f(x1+50,y1-50,0); glVertex3f(x1,y1-50,0); } else{ glColor3f(202.0/255.00, 169.0/255.0, 106.0/255.0); // glColor3f(1.0,1.0,1.0); glVertex3f(x1,y1,0); glVertex3f(x1+50,y1,0); glVertex3f(x1+50,y1-50,0); glVertex3f(x1,y1-50,0); } } glEnd(); } } } void Display() { glClear(GL_COLOR_BUFFER_BIT); //calling CheckerBoard(); glFlush (); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (900, 450); glutInitWindowPosition (100, 100); glutCreateWindow ("Assignment: Lab 2"); init (); glutDisplayFunc(Display); glutMainLoop(); }