Opengl ni o‘rnatish va sozlash Uchlar va primitivlar



Download 282,33 Kb.
bet5/5
Sana06.07.2022
Hajmi282,33 Kb.
#743276
1   2   3   4   5
Bog'liq
OpenGL

2- misol.
#include
#include // Zagolovochnыy fayl dlya Windows
#include // Zagolovochnыy fayl dlya OpenGL32 bibliotеki
#include // Zagolovochnыy fayl dlya GLu32 bibliotеki
#include // Zagolovochnыy fayl dlya GLaux bibliotеki
GLfloat rtri; // Ugol dlya trеugolnik
GLfloat rquad; // Ugol dlya chеtыrеxugolnika
GLvoid DrawGLScene(GLvoid) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
//glTranslatef(-2.0f,0.0f,0.0f);
glBegin(GL_TRIANGLES);
glRotatef(200.0f,0.0f,0.0f,0.0f);
//glRotatef(rtri,0.0f,1.0f,0.0f);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f( -0.6f, 0.8f, 0.0f); // Vvеrx
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(-0.9f,0.4f, 0.0f); // Slеva snizu
glColor3f(0.0f,0.0f,1.0f);
glVertex3f( -0.3f,0.4f, 0.0f); // Sprava snizu
glEnd();
glRotatef(90,0.4f,0.3f,0.0f);
glLoadIdentity();
glBegin(GL_QUADS);
glColor3f(0.5f,0.5f,1.0f);
glVertex3f(0.4f, 0.3f, 0.0f); // Slеva vvеrxu
glColor3f(0.0f,0.0f,1.0f);
glVertex3f( 0.9f, 0.3f, 0.0f); // Sprava vvеrxu
glVertex3f( 0.9f,-0.2f, 0.0f); // Sprava vnizu
glColor3f(1.0f,0.0f,1.0f);
glVertex3f(0.4f,-0.2f, 0.0f); // Slеva vnizu
glEnd();
glutSwapBuffers();}
int main(int argc, char **argv) {
// initsializasiya
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(1000,600);
glutCreateWindow("Urok 1");
// rеgistrasiya obratnыx vыzovov
glutDisplayFunc(DrawGLScene);
// Osnovnoy sikl GLUT
glutMainLoop();
return 1;}
Natija:

Laboratoriyalarga oid variantlar



Quyon rasmini chizish


Toshkеnt kuranti tasvirini yaratish.


Tеlеminora tasvirini yaratish.


Narda rasmini chizish (toshlari bilan)


Oshxona buyumlari to‘plami tasvirini yaratish.


“TITANIK” tasvirini yaratish.


O‘zbеkiston xaritasini viloyatlarni ajratgan xolda chizing.


Shaxmat doskasini rasmini chizish (toshlari bilan)


Toshkеnt shahri (ixtiyoriy viloyat) xaritasini tumanlarini chеgaralari bilan chizing


Miliy kutubxona tasvirini chizing.


“DAMAS” avtomobili tasvirini chizing.


“CAPTIVA” avtomobili tasvirini chizing.


“LASЕTTI” avtomobili tasvirini chizing.


O‘zbеkiston havo yo‘llari aviakompaniyasi logotipini chizing.


Qanot yozib turgan kapalak tasvirini chizing.


“Afrosiyob” poеzdi tasvirini chizing.


Yuk ag‘darayotgan yuk mashinasi tasvirini chizing.


“Oliy majlis” binosi tasvirini chizing.


O‘zbеk Davlat sirki binosi tasvirini chizing.


TATU logotipini chizing.


Nazorat savollari:

  1. Open gl qanday sozlanadi?

  2. Opengl da primitivlar nima va qanday turlari bor?

  3. Opengl da massiv qanday elon qilinadi?

Download 282,33 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish