OpenGL Programming Related Links The Official OpenGL Website OpenGL v1.1 Redbook
CG 02 Introduction to OpenGL
-
Upload
fian-mario-syahputra -
Category
Documents
-
view
225 -
download
0
Transcript of CG 02 Introduction to OpenGL
-
8/18/2019 CG 02 Introduction to OpenGL
1/11
02 |Introduction to OpenGLEriq Muhammad Adams J |
-
8/18/2019 CG 02 Introduction to OpenGL
2/11
hat is OpenGL !
• Low-level Graphics API (ApplicationProgramming Interface) / antarmukaperangkat lunak ke kartu gras.
• Inepenen terhaap platform (han!amen!eiakan fungsi gras" tiakmen!eiakan fungsi !ang epenenterhaap platform # input hanling"
winowing" s$).
• %an!ak igunakan i aplikasi gras # &A'programs" games" ata visualiation" s$.
-
8/18/2019 CG 02 Introduction to OpenGL
3/11
OpenGL "istor#
• 'ikem$angkan pertama kali oleh GI(ilicon Graphics" Inc).
• *++, iam$il alih oleh penGL A%(Architecture eview %oar) # 'La$s"A0I" 'ell" 1vans 2 utherlan" 3ewlett-Packar" I%4" Intel" 4atro5" 67I'IA" GI"
un 4icros!stems se$agai pem$uatan pengelola spesikasi penGL.
• ,889 ikontrol oleh 0he :hronos group.
-
8/18/2019 CG 02 Introduction to OpenGL
4/11
OpenGL Architecture
• e$uah state machine" contoh untukmenggam$ar o$;ek engan warna merahprogrammer harus meru$ah color state ke
merah lalu menggam$ar o$;ek terse$ut.• 0etapi se;ak penGL .8 (programma$le
pipeline/shaer $ase) men;ai less state-oriente API # state functions untuk color"normals" lighting eprecate (kaaluarsa).
-
8/18/2019 CG 02 Introduction to OpenGL
5/11
$i%ed&$unction 's
(rogramma)ilit#• e5i$le an muah ikontrol olehprogrammer.
• Aa ;enis shaers # 7erte5 shaers
(memoikasi verte5)"
-
8/18/2019 CG 02 Introduction to OpenGL
6/11
OpenGL *endering
(ipeline
-
8/18/2019 CG 02 Introduction to OpenGL
7/11
*elated Li)raries
• GL=0 (penGL =tilit! 0oolkit)men!eiakan fungsi untukwinowing" menus" input-hanling.
• 'L (imple 'irect 4eia La!er) #li$rari multimeia cross-platform .
• GL
-
8/18/2019 CG 02 Introduction to OpenGL
8/11
OpenGL +#nta%
• 'iawali engan awalan gl #gl7erte5f()
• 6omor menun;ukkan ;umlahparameter # gl7erte5f(*.8f" *.8f"*.8f) pun!a parameter
• 3uruf setelah nomor menun;ukkantipe ata parameter # gl7erte5f ()$ertipe ata f loat.
-
8/18/2019 CG 02 Introduction to OpenGL
9/11
+imple ,G (rogram
Architecture• %erisi koe inisialisasi #penciptaan winow" loaingresource" s$ .
• $erisi nite loop untukupate logika" an
renering.
Inisialisasi
-pdatelogia
*endering
/e&
Inisialisasi
eluar!
-
8/18/2019 CG 02 Introduction to OpenGL
10/11
+etup OpenGL 1using
GL$• ilakan lihat petun;uk an unuhcontoh emo program ihttps#//githu$.com/e@ams/graka-
komputer
-
8/18/2019 CG 02 Introduction to OpenGL
11/11
"ello OpenGL 3
https455githu).com5e6dams5gra7a&omputer5tree5master5#our8pro9