SlideShare a Scribd company logo
1 of 2
#include <GL/glut.h>
double angle = 0;
void initialize()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
}
void draw()
{
glClear(GL_COLOR_BUFFER_BIT);
glRotatef(angle, 0.0, 0.0, 1.0);
//R
glPushMatrix();
glBegin(GL_LINES);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(-0.4, -0.2, 0.0); //1
glVertex3f(-0.4, 0.2, 0.0); //2
glVertex3f(-0.4, 0.2, 0.0); //3
glVertex3f(-0.2, 0.2, 0.0); //4
glVertex3f(-0.2, 0.2, 0.0); //5
glVertex3f(-0.2, -0.001, 0.0); //0.01 is taken for not extending to
//something else rather than R
glVertex3f(-0.4, 0.0, 0.0); //7
glVertex3f(-0.2, 0.0, 0.0);//8
glVertex3f(-0.4, 0.0, 0.0); //R bottom
glVertex3f(-0.2, -0.2, 0.0);//R bottom
glEnd();
//O
glBegin(GL_LINES);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(0.2, -0.2, 0.0);
glVertex3f(0.2, 0.2, 0.0);
glVertex3f(0.0, 0.2, 0.0);//11
glVertex3f(0.0, -0.2, 0.0);//12
glVertex3f(0.0, -0.2, 0.0);//13
glVertex3f(0.2, -0.2, 0.0);//14
glVertex3f(-0.004, 0.2, 0.0);// drawing first line for 'O header
glVertex3f(0.2, 0.2, 0.0);
glEnd();
//B
glBegin(GL_LINES);
glColor3f(0.5, 0.5, 0.0);
glVertex3f(0.3, -0.2, 0.0);
glVertex3f(0.3, 0.2, 0.0);
glVertex3f(0.3, 0.2, 0.0);
glVertex3f(0.5, 0.2, 0.0);
glVertex3f(0.5, 0.2, 0.0);
glVertex3f(0.5, -0.2, 0.0);
glVertex3f(0.5, -0.2, 0.0);
glVertex3f(0.3, -0.2, 0.0);
glVertex3f(0.3, 0.0, 0.0);
glVertex3f(0.5, 0.0, 0.0);
glEnd();
glPopMatrix();
//I
glBegin(GL_LINES);
glColor3f(0.0, 1.0, 0.0);
glVertex3f( 0.62, 0.2, 0.0);//for drawing 'I' after 'B' we take 0.6 along
x-axis
glVertex3f(0.62, -0.2, 0.0);//10
glEnd();
glutSwapBuffers(); //
}
void update(int value) {
angle = angle + 0.01;
if(angle == 360) angle = 0;
glutPostRedisplay();
glutTimerFunc(30,update,0);
}
int main(int iArgc, char** cppArgv) {
glutInit(&iArgc, cppArgv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowPosition(200, 200);
glutInitWindowSize(500, 500);
glutCreateWindow("ROBI");
initialize();
glutDisplayFunc(draw);
glutTimerFunc(50, update, 0); //after 10 sec the drawing "ROBI" will start
to sprin faster
glutMainLoop();
}

More Related Content

Viewers also liked (16)

Accesorios en panel de control
Accesorios en panel de controlAccesorios en panel de control
Accesorios en panel de control
 
Ferrer et al. 2015
Ferrer et al. 2015Ferrer et al. 2015
Ferrer et al. 2015
 
La paradoja
La paradojaLa paradoja
La paradoja
 
Ass day2 3_sun_moon_earth
Ass day2 3_sun_moon_earthAss day2 3_sun_moon_earth
Ass day2 3_sun_moon_earth
 
Nation State dan Khilafah
Nation State dan KhilafahNation State dan Khilafah
Nation State dan Khilafah
 
เด่นชัย
เด่นชัยเด่นชัย
เด่นชัย
 
How II Navigate PowerPoint Presentation
How II Navigate PowerPoint PresentationHow II Navigate PowerPoint Presentation
How II Navigate PowerPoint Presentation
 
Relative Clauses
Relative ClausesRelative Clauses
Relative Clauses
 
An inquiry based project for stem
An inquiry based project for stemAn inquiry based project for stem
An inquiry based project for stem
 
ลอง
ลองลอง
ลอง
 
Ultimo formato magola
Ultimo formato magolaUltimo formato magola
Ultimo formato magola
 
Tecnotaaller
TecnotaallerTecnotaaller
Tecnotaaller
 
สอง
สองสอง
สอง
 
Introduction of Data Reporting Process, Objective and Reporting Template
Introduction of Data Reporting Process, Objective and Reporting TemplateIntroduction of Data Reporting Process, Objective and Reporting Template
Introduction of Data Reporting Process, Objective and Reporting Template
 
วังชิ้น
วังชิ้นวังชิ้น
วังชิ้น
 
Casie Snyder Resume
Casie Snyder ResumeCasie Snyder Resume
Casie Snyder Resume
 

Similar to Ass day2 2_rotating my name (robi)

Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Aila Gema Safitri
 
#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.docxajoy21
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportBijoy679
 
Ass day2 1_checkerboard...copy in cpp
Ass day2 1_checkerboard...copy in cppAss day2 1_checkerboard...copy in cpp
Ass day2 1_checkerboard...copy in cppRobi Parvez
 
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
 
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 - ExercisesMichel Alves
 
The fallowing program shows the simple transformation #define GLEW.pdf
The fallowing program shows the simple transformation #define GLEW.pdfThe fallowing program shows the simple transformation #define GLEW.pdf
The fallowing program shows the simple transformation #define GLEW.pdfarwholesalelors
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.pptEngrZamaan
 
glut dev c++ membuat nama
glut dev c++ membuat namaglut dev c++ membuat nama
glut dev c++ membuat namaDitta Paski
 
square.cpp Open
 square.cpp Open square.cpp Open
square.cpp OpenMikeEly930
 

Similar to Ass day2 2_rotating my name (robi) (20)

Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
 
Development with OpenGL and Qt
Development with OpenGL and QtDevelopment with OpenGL and Qt
Development with OpenGL and Qt
 
Practicing 2d drawing primitives
Practicing 2d drawing primitivesPracticing 2d drawing primitives
Practicing 2d drawing primitives
 
Komputer Grafik
Komputer GrafikKomputer Grafik
Komputer Grafik
 
#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
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
 
2D Drawing
2D Drawing2D Drawing
2D Drawing
 
Ass day2 1_checkerboard...copy in cpp
Ass day2 1_checkerboard...copy in cppAss day2 1_checkerboard...copy in cpp
Ass day2 1_checkerboard...copy in cpp
 
Manual
ManualManual
Manual
 
Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function Robot In OpenGL Using Line Function
Robot In OpenGL Using Line Function
 
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 fallowing program shows the simple transformation #define GLEW.pdf
The fallowing program shows the simple transformation #define GLEW.pdfThe fallowing program shows the simple transformation #define GLEW.pdf
The fallowing program shows the simple transformation #define GLEW.pdf
 
Laporan modul2
Laporan modul2Laporan modul2
Laporan modul2
 
Transformasi 2 dmensi
Transformasi 2 dmensiTransformasi 2 dmensi
Transformasi 2 dmensi
 
Draw Star in Visual Studio
Draw Star in Visual StudioDraw Star in Visual Studio
Draw Star in Visual Studio
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
 
glut dev c++ membuat nama
glut dev c++ membuat namaglut dev c++ membuat nama
glut dev c++ membuat nama
 
square.cpp Open
 square.cpp Open square.cpp Open
square.cpp Open
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

Ass day2 2_rotating my name (robi)

  • 1. #include <GL/glut.h> double angle = 0; void initialize() { glClearColor(0.0, 0.0, 0.0, 0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); } void draw() { glClear(GL_COLOR_BUFFER_BIT); glRotatef(angle, 0.0, 0.0, 1.0); //R glPushMatrix(); glBegin(GL_LINES); glColor3f(1.0, 0.0, 0.0); glVertex3f(-0.4, -0.2, 0.0); //1 glVertex3f(-0.4, 0.2, 0.0); //2 glVertex3f(-0.4, 0.2, 0.0); //3 glVertex3f(-0.2, 0.2, 0.0); //4 glVertex3f(-0.2, 0.2, 0.0); //5 glVertex3f(-0.2, -0.001, 0.0); //0.01 is taken for not extending to //something else rather than R glVertex3f(-0.4, 0.0, 0.0); //7 glVertex3f(-0.2, 0.0, 0.0);//8 glVertex3f(-0.4, 0.0, 0.0); //R bottom glVertex3f(-0.2, -0.2, 0.0);//R bottom glEnd(); //O glBegin(GL_LINES); glColor3f(0.0, 0.0, 1.0); glVertex3f(0.2, -0.2, 0.0); glVertex3f(0.2, 0.2, 0.0); glVertex3f(0.0, 0.2, 0.0);//11 glVertex3f(0.0, -0.2, 0.0);//12 glVertex3f(0.0, -0.2, 0.0);//13 glVertex3f(0.2, -0.2, 0.0);//14 glVertex3f(-0.004, 0.2, 0.0);// drawing first line for 'O header glVertex3f(0.2, 0.2, 0.0); glEnd(); //B glBegin(GL_LINES); glColor3f(0.5, 0.5, 0.0); glVertex3f(0.3, -0.2, 0.0); glVertex3f(0.3, 0.2, 0.0); glVertex3f(0.3, 0.2, 0.0); glVertex3f(0.5, 0.2, 0.0); glVertex3f(0.5, 0.2, 0.0); glVertex3f(0.5, -0.2, 0.0); glVertex3f(0.5, -0.2, 0.0); glVertex3f(0.3, -0.2, 0.0); glVertex3f(0.3, 0.0, 0.0); glVertex3f(0.5, 0.0, 0.0); glEnd();
  • 2. glPopMatrix(); //I glBegin(GL_LINES); glColor3f(0.0, 1.0, 0.0); glVertex3f( 0.62, 0.2, 0.0);//for drawing 'I' after 'B' we take 0.6 along x-axis glVertex3f(0.62, -0.2, 0.0);//10 glEnd(); glutSwapBuffers(); // } void update(int value) { angle = angle + 0.01; if(angle == 360) angle = 0; glutPostRedisplay(); glutTimerFunc(30,update,0); } int main(int iArgc, char** cppArgv) { glutInit(&iArgc, cppArgv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowPosition(200, 200); glutInitWindowSize(500, 500); glutCreateWindow("ROBI"); initialize(); glutDisplayFunc(draw); glutTimerFunc(50, update, 0); //after 10 sec the drawing "ROBI" will start to sprin faster glutMainLoop(); }