SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Make Robot Using Line Function In OpenGL
#include "stdafx.h"
// Run by Visual C++ 6 with OpenGL
#include <GL/glut.h>
void init (void)
{
/* select clearing (background) color */
glClearColor (0.0, 0.0, 0.0, 0.0);
// (red, green, blue, alpha), used by glClear
/* initialize viewing values */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
// (left, right, bottom, top, near, far)
}
void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
//head
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.33, 0.75);
glVertex2f (0.18, 0.75);
glVertex2f (0.18, 0.55);
glVertex2f (0.33, 0.55);
glVertex2f (0.18, 0.75);
glVertex2f (0.18, 0.55);
glVertex2f (0.33, 0.75);
glVertex2f (0.33, 0.55);
glEnd();
//neck
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.28, 0.55);
glVertex2f (0.23, 0.55);
glVertex2f (0.23, 0.40);
glVertex2f (0.28, 0.40);
glVertex2f (0.23, 0.55);
glVertex2f (0.23, 0.40);
glVertex2f (0.28, 0.55);
glVertex2f (0.28, 0.40);
glEnd();
//body
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.40, 0.40);
glVertex2f (0.10, 0.40);
glVertex2f (0.10, -0.10);
glVertex2f (0.40, -0.10);
glVertex2f (0.10, 0.40);
glVertex2f (0.10, -0.10);
glVertex2f (0.40, 0.40);
glVertex2f (0.40, -0.10);
glEnd();
//right hand
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.48, 0.20);
glVertex2f (0.40, 0.40);
glVertex2f (0.40, 0.28);
glVertex2f (0.48, 0.10);
glVertex2f (0.48, 0.20);
glVertex2f (0.48, 0.10);
glEnd();
//left hand
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (-0.00, 0.20);
glVertex2f (0.10, 0.40);
glVertex2f (0.10, 0.28);
glVertex2f (-0.00, 0.10);
glVertex2f (-0.00, 0.20);
glVertex2f (-0.00, 0.10);
glEnd();
//right leg
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.40, -0.10);
glVertex2f (0.35, -0.10);
glVertex2f (0.35, -0.40);
glVertex2f (0.40, -0.40);
glVertex2f (0.35, -0.10);
glVertex2f (0.35, -0.40);
glVertex2f (0.40, -0.10);
glVertex2f (0.40, -0.40);
glEnd();
//left leg
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.15, -0.10);
glVertex2f (0.10, -0.10);
glVertex2f (0.10, -0.40);
glVertex2f (0.15, -0.40);
glVertex2f (0.10, -0.10);
glVertex2f (0.10, -0.40);
glVertex2f (0.15, -0.10);
glVertex2f (0.15, -0.40);
glEnd();
//right eye
glColor3f (0.0, 1.0, 1.0);
glBegin(GL_POINTS); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.29, 0.67);
glEnd();
//left eye
glColor3f (0.0, 1.0, 1.0);
glBegin(GL_POINTS); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.23, 0.67);
glEnd();
//line
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho()
glVertex2f (0.29, 0.61);
glVertex2f (0.23, 0.61);
glEnd();
glFlush ();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitWindowSize (600, 500);
glutInitWindowPosition (200, 100);
// Screen origin (0,0) is at Top Left
glutCreateWindow ("Hello Computer Graphics Students");
init();// calling init()
glutDisplayFunc(display); // glut call back function, calling display()
glutMainLoop();
return 0; // ANSI C requires main to return int.
}

Weitere ähnliche Inhalte

Was ist angesagt?

Quản lý người dùng
Quản lý người dùngQuản lý người dùng
Quản lý người dùngGetfly CRM
 
Mối quan hệ giữa class và object
Mối quan hệ giữa class và objectMối quan hệ giữa class và object
Mối quan hệ giữa class và objectTrực Lê Công
 
đồ áN chuyên đề đồ họa ứng dụng
đồ áN chuyên đề đồ họa ứng dụngđồ áN chuyên đề đồ họa ứng dụng
đồ áN chuyên đề đồ họa ứng dụngLàm Thuê Đồ Án
 
[Kho tài liệu ngành may] đồ án tốt nghiệp chuyên ngành thiết kế thời trang ...
[Kho tài liệu ngành may] đồ án tốt nghiệp   chuyên ngành thiết kế thời trang ...[Kho tài liệu ngành may] đồ án tốt nghiệp   chuyên ngành thiết kế thời trang ...
[Kho tài liệu ngành may] đồ án tốt nghiệp chuyên ngành thiết kế thời trang ...TÀI LIỆU NGÀNH MAY
 
csdl-trigger
csdl-triggercsdl-trigger
csdl-triggerkikihoho
 
Báo cáo thực tập ngành may quy trình sản xuất áo jacket
Báo cáo thực tập ngành may   quy trình sản xuất áo jacketBáo cáo thực tập ngành may   quy trình sản xuất áo jacket
Báo cáo thực tập ngành may quy trình sản xuất áo jacketTÀI LIỆU NGÀNH MAY
 
Lập trình trong_autocad
Lập trình trong_autocadLập trình trong_autocad
Lập trình trong_autocadDuy Tân
 
Phan tich thiet_ke_he_thong_quan_ly_part_4
Phan tich thiet_ke_he_thong_quan_ly_part_4Phan tich thiet_ke_he_thong_quan_ly_part_4
Phan tich thiet_ke_he_thong_quan_ly_part_4caolanphuong
 
Mức cô lập SQL
Mức cô lập SQLMức cô lập SQL
Mức cô lập SQLĐức Lê
 
Bai tap va loi giai sql
Bai tap va loi giai sqlBai tap va loi giai sql
Bai tap va loi giai sql. .
 
Sao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vnSao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vnzBackupVN
 
Hướng dẫn WebGis cơ bản - Basic Guide WebGis
Hướng dẫn WebGis cơ bản - Basic Guide WebGisHướng dẫn WebGis cơ bản - Basic Guide WebGis
Hướng dẫn WebGis cơ bản - Basic Guide WebGisThuận Phạm Văn
 
Bài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lýBài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lýMasterCode.vn
 
[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới độ tuổi từ 16...
[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới  độ tuổi từ 16...[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới  độ tuổi từ 16...
[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới độ tuổi từ 16...TÀI LIỆU NGÀNH MAY
 
Bài giảng sql server 2008
Bài giảng sql server 2008Bài giảng sql server 2008
Bài giảng sql server 2008thai
 
Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...
Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...
Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...https://www.facebook.com/garmentspace
 
Bài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL server
Bài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL serverBài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL server
Bài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL serverMasterCode.vn
 

Was ist angesagt? (20)

Quản lý người dùng
Quản lý người dùngQuản lý người dùng
Quản lý người dùng
 
Mối quan hệ giữa class và object
Mối quan hệ giữa class và objectMối quan hệ giữa class và object
Mối quan hệ giữa class và object
 
Đề tài: Phần mềm quản lý thông tin sinh viên, HOT, 9đ
Đề tài: Phần mềm quản lý thông tin sinh viên, HOT, 9đĐề tài: Phần mềm quản lý thông tin sinh viên, HOT, 9đ
Đề tài: Phần mềm quản lý thông tin sinh viên, HOT, 9đ
 
đồ áN chuyên đề đồ họa ứng dụng
đồ áN chuyên đề đồ họa ứng dụngđồ áN chuyên đề đồ họa ứng dụng
đồ áN chuyên đề đồ họa ứng dụng
 
[Kho tài liệu ngành may] đồ án tốt nghiệp chuyên ngành thiết kế thời trang ...
[Kho tài liệu ngành may] đồ án tốt nghiệp   chuyên ngành thiết kế thời trang ...[Kho tài liệu ngành may] đồ án tốt nghiệp   chuyên ngành thiết kế thời trang ...
[Kho tài liệu ngành may] đồ án tốt nghiệp chuyên ngành thiết kế thời trang ...
 
csdl-trigger
csdl-triggercsdl-trigger
csdl-trigger
 
Giao trinh ky thuat lap trinh 2
Giao trinh ky thuat lap trinh 2Giao trinh ky thuat lap trinh 2
Giao trinh ky thuat lap trinh 2
 
Báo cáo thực tập ngành may quy trình sản xuất áo jacket
Báo cáo thực tập ngành may   quy trình sản xuất áo jacketBáo cáo thực tập ngành may   quy trình sản xuất áo jacket
Báo cáo thực tập ngành may quy trình sản xuất áo jacket
 
Lập trình trong_autocad
Lập trình trong_autocadLập trình trong_autocad
Lập trình trong_autocad
 
Phan tich thiet_ke_he_thong_quan_ly_part_4
Phan tich thiet_ke_he_thong_quan_ly_part_4Phan tich thiet_ke_he_thong_quan_ly_part_4
Phan tich thiet_ke_he_thong_quan_ly_part_4
 
Mức cô lập SQL
Mức cô lập SQLMức cô lập SQL
Mức cô lập SQL
 
Bai tap va loi giai sql
Bai tap va loi giai sqlBai tap va loi giai sql
Bai tap va loi giai sql
 
Sao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vnSao lưu & phục hồi database SQL Server | zBackup.vn
Sao lưu & phục hồi database SQL Server | zBackup.vn
 
Hướng dẫn WebGis cơ bản - Basic Guide WebGis
Hướng dẫn WebGis cơ bản - Basic Guide WebGisHướng dẫn WebGis cơ bản - Basic Guide WebGis
Hướng dẫn WebGis cơ bản - Basic Guide WebGis
 
Luận án: Vai trò của Chính phủ trong quy trình lập pháp ở Việt Nam
Luận án: Vai trò của Chính phủ trong quy trình lập pháp ở Việt NamLuận án: Vai trò của Chính phủ trong quy trình lập pháp ở Việt Nam
Luận án: Vai trò của Chính phủ trong quy trình lập pháp ở Việt Nam
 
Bài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lýBài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lý
 
[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới độ tuổi từ 16...
[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới  độ tuổi từ 16...[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới  độ tuổi từ 16...
[Kho tài liệu ngành may] nghiên cứu trang phục dạo phố nữ giới độ tuổi từ 16...
 
Bài giảng sql server 2008
Bài giảng sql server 2008Bài giảng sql server 2008
Bài giảng sql server 2008
 
Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...
Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...
Khóa luận tốt nghiệp Phân tích, thiết kế hệ thống thông tin quản lý nhân sự t...
 
Bài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL server
Bài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL serverBài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL server
Bài 3 : Các ràng buộc toàn vẹn dữ liệu - SQL server
 

Andere mochten auch

CS 354 GPU Architecture
CS 354 GPU ArchitectureCS 354 GPU Architecture
CS 354 GPU ArchitectureMark Kilgard
 
Report gl project group zyl
Report gl project group zyl Report gl project group zyl
Report gl project group zyl Z Syp
 
CS 354 More Graphics Pipeline
CS 354 More Graphics PipelineCS 354 More Graphics Pipeline
CS 354 More Graphics PipelineMark Kilgard
 
Programming using opengl in visual c++
Programming   using opengl in visual c++Programming   using opengl in visual c++
Programming using opengl in visual c++Ta Nam
 
Creating a game using C++, OpenGL and Qt
Creating a game using C++, OpenGL and QtCreating a game using C++, OpenGL and Qt
Creating a game using C++, OpenGL and Qtguestd5d4ce
 
Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Team Codingparks
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingMark Kilgard
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 IntroductionMark Kilgard
 
OpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSOpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSRAJEEV KUMAR SINGH
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.Mohd Arif
 
The 3D Printing Transformation
The 3D Printing TransformationThe 3D Printing Transformation
The 3D Printing TransformationSimon Lancaster
 

Andere mochten auch (12)

CS 354 GPU Architecture
CS 354 GPU ArchitectureCS 354 GPU Architecture
CS 354 GPU Architecture
 
Report gl project group zyl
Report gl project group zyl Report gl project group zyl
Report gl project group zyl
 
CS 354 More Graphics Pipeline
CS 354 More Graphics PipelineCS 354 More Graphics Pipeline
CS 354 More Graphics Pipeline
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Programming using opengl in visual c++
Programming   using opengl in visual c++Programming   using opengl in visual c++
Programming using opengl in visual c++
 
Creating a game using C++, OpenGL and Qt
Creating a game using C++, OpenGL and QtCreating a game using C++, OpenGL and Qt
Creating a game using C++, OpenGL and Qt
 
Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and Culling
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 Introduction
 
OpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSOpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELS
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.
 
The 3D Printing Transformation
The 3D Printing TransformationThe 3D Printing Transformation
The 3D Printing Transformation
 

Ähnlich wie Robot In OpenGL Using Line Function

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 at openGL
computer graphics at openGLcomputer graphics at openGL
computer graphics at openGLYasir Khan
 
Ass day3 1_bd flag
Ass day3 1_bd flagAss day3 1_bd flag
Ass day3 1_bd flagRobi Parvez
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportBijoy679
 
computer graphics at openGL (2)
computer graphics at openGL (2)computer graphics at openGL (2)
computer graphics at openGL (2)Yasir Khan
 
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 184Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210Mahmoud Samir Fayed
 
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
 
Ass day3 2_olympic logos
Ass day3 2_olympic logosAss day3 2_olympic logos
Ass day3 2_olympic logosRobi Parvez
 
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
 
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
 
#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
 
The Ring programming language version 1.10 book - Part 67 of 212
The Ring programming language version 1.10 book - Part 67 of 212The Ring programming language version 1.10 book - Part 67 of 212
The Ring programming language version 1.10 book - Part 67 of 212Mahmoud Samir Fayed
 

Ähnlich wie Robot In OpenGL Using Line Function (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)
 
computer graphics at openGL
computer graphics at openGLcomputer graphics at openGL
computer graphics at openGL
 
Robot by gulnaz
Robot by gulnazRobot by gulnaz
Robot by gulnaz
 
Ass day3 1_bd flag
Ass day3 1_bd flagAss day3 1_bd flag
Ass day3 1_bd flag
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
 
computer graphics at openGL (2)
computer graphics at openGL (2)computer graphics at openGL (2)
computer graphics at openGL (2)
 
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
 
The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196The Ring programming language version 1.7 book - Part 60 of 196
The Ring programming language version 1.7 book - Part 60 of 196
 
The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210The Ring programming language version 1.9 book - Part 65 of 210
The Ring programming language version 1.9 book - Part 65 of 210
 
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
 
Ass day3 2_olympic logos
Ass day3 2_olympic logosAss day3 2_olympic logos
Ass day3 2_olympic logos
 
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
 
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
 
Practicing 2d drawing primitives
Practicing 2d drawing primitivesPracticing 2d drawing primitives
Practicing 2d drawing primitives
 
#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
 
Draw Star in Visual Studio
Draw Star in Visual StudioDraw Star in Visual Studio
Draw Star in Visual Studio
 
The Ring programming language version 1.10 book - Part 67 of 212
The Ring programming language version 1.10 book - Part 67 of 212The Ring programming language version 1.10 book - Part 67 of 212
The Ring programming language version 1.10 book - Part 67 of 212
 

Kürzlich hochgeladen

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 

Robot In OpenGL Using Line Function

  • 1. Make Robot Using Line Function In OpenGL #include "stdafx.h" // Run by Visual C++ 6 with OpenGL #include <GL/glut.h> void init (void) { /* select clearing (background) color */ glClearColor (0.0, 0.0, 0.0, 0.0); // (red, green, blue, alpha), used by glClear /* initialize viewing values */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); // (left, right, bottom, top, near, far) } void display(void) { glClear (GL_COLOR_BUFFER_BIT);
  • 2. //head glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.33, 0.75); glVertex2f (0.18, 0.75); glVertex2f (0.18, 0.55); glVertex2f (0.33, 0.55); glVertex2f (0.18, 0.75); glVertex2f (0.18, 0.55); glVertex2f (0.33, 0.75); glVertex2f (0.33, 0.55); glEnd(); //neck glColor3f (1.0, 1.0, 1.0);
  • 3. glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.28, 0.55); glVertex2f (0.23, 0.55); glVertex2f (0.23, 0.40); glVertex2f (0.28, 0.40); glVertex2f (0.23, 0.55); glVertex2f (0.23, 0.40); glVertex2f (0.28, 0.55); glVertex2f (0.28, 0.40); glEnd(); //body glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.40, 0.40); glVertex2f (0.10, 0.40); glVertex2f (0.10, -0.10); glVertex2f (0.40, -0.10);
  • 4. glVertex2f (0.10, 0.40); glVertex2f (0.10, -0.10); glVertex2f (0.40, 0.40); glVertex2f (0.40, -0.10); glEnd(); //right hand glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.48, 0.20); glVertex2f (0.40, 0.40); glVertex2f (0.40, 0.28); glVertex2f (0.48, 0.10); glVertex2f (0.48, 0.20); glVertex2f (0.48, 0.10); glEnd();
  • 5. //left hand glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (-0.00, 0.20); glVertex2f (0.10, 0.40); glVertex2f (0.10, 0.28); glVertex2f (-0.00, 0.10); glVertex2f (-0.00, 0.20); glVertex2f (-0.00, 0.10); glEnd(); //right leg glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.40, -0.10); glVertex2f (0.35, -0.10);
  • 6. glVertex2f (0.35, -0.40); glVertex2f (0.40, -0.40); glVertex2f (0.35, -0.10); glVertex2f (0.35, -0.40); glVertex2f (0.40, -0.10); glVertex2f (0.40, -0.40); glEnd(); //left leg glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.15, -0.10); glVertex2f (0.10, -0.10); glVertex2f (0.10, -0.40); glVertex2f (0.15, -0.40);
  • 7. glVertex2f (0.10, -0.10); glVertex2f (0.10, -0.40); glVertex2f (0.15, -0.10); glVertex2f (0.15, -0.40); glEnd(); //right eye glColor3f (0.0, 1.0, 1.0); glBegin(GL_POINTS); // Center is at the mid of main window due to glOrtho() glVertex2f (0.29, 0.67); glEnd(); //left eye glColor3f (0.0, 1.0, 1.0); glBegin(GL_POINTS); // Center is at the mid of main window due to glOrtho() glVertex2f (0.23, 0.67); glEnd();
  • 8. //line glColor3f (1.0, 1.0, 1.0); glBegin(GL_LINES); // Center is at the mid of main window due to glOrtho() glVertex2f (0.29, 0.61); glVertex2f (0.23, 0.61); glEnd(); glFlush (); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitWindowSize (600, 500); glutInitWindowPosition (200, 100); // Screen origin (0,0) is at Top Left glutCreateWindow ("Hello Computer Graphics Students"); init();// calling init() glutDisplayFunc(display); // glut call back function, calling display() glutMainLoop(); return 0; // ANSI C requires main to return int. }