COMPUTER GRAPHICS D10K-5C01 GK11: OpenGL Transformasi dan Interaksi Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas.

Slides:



Advertisements
Presentasi serupa
Geometric Transformations
Advertisements

Linear Algebra (Aljabar Linier) Week 14
Imam Cholissodin| 04 |Transformations Imam Cholissodin|
SUBPROGRAM IN PASCAL PROCEDURE Lecture 5 CS1023.
TEKNIK PENGINTEGRALAN
Eriq Muhammad Adams J | 04 |Transformation Eriq Muhammad Adams J |
05 |Beyond Transformation Eriq Muhammad Adams J |
Imam Cholissodin| 06 | Viewing / Camera Imam Cholissodin|
1 DATA STRUCTURE “ STACK” SHINTA P STMIK MDP APRIL 2011.
Imam Cholissodin| 06 | Viewing / Camera Imam Cholissodin|
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
1 Diselesaikan Oleh KOMPUTER Langkah-langkah harus tersusun secara LOGIS dan Efisien agar dapat menyelesaikan tugas dengan benar dan efisien. ALGORITMA.
Menulis Kolom  Kolom adalah opini atau artikel. Tidak seperti editorial, kolom memiliki byline.  Kolom Biasanya ditulis reguler. Biasanya mingguan atau.
METHOD, ARRAY DAN STRING
Memory and Storage Chapter 24 Subject: Digital System Year: 2009.
Pokok bahasan: State Diagram State Substate Events dan transition State Diagram Developing Software Woth UML Booch Jacobson Rumbaugh Addison-Wesley.
(HTML). Frames are most typically used to have a menu in one frame, and content in another frame. When someone clicks a link on the menu that web page.
Transformasi Linear dan Sistem Persamaan Linear Pertemuan 5
PERTEMUAN KE-6 UNIFIED MODELLING LANGUAGE (UML) (Part 2)
HAMPIRAN NUMERIK SOLUSI PERSAMAAN NIRLANJAR Pertemuan 3
1 Pertemuan 8 JARINGAN COMPETITIVE Matakuliah: H0434/Jaringan Syaraf Tiruan Tahun: 2005 Versi: 1.
1 Pertemuan 11 Function dari System Matakuliah: M0446/Analisa dan Perancangan Sistem Informasi Tahun: 2005 Versi: 0/0.
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
F ORM Bayu Priyambadha, S.Kom. F ORM Form is the interface (user interface) for users to communicate with the application system. Each posted data from.
Binary Search Tree. Sebuah node di Binary Search Tree memiliki path yang unik dari root menurut aturan ordering – Sebuah Node, mempunyai subtree kiri.
OPERATOR DAN FUNGSI MATEMATIK. Operator  Assignment operator Assignment operator (operator pengerjaan) menggunakan simbol titik dua diikuti oleh tanda.
Backup DISUSUN OLEH: LUTHFAN HADI PRAMONO, S.ST HANYA DIPERGUNAKAN UNTUK KEPENTINGAN PENGAJARAN DI LINGKUNGAN POLITEKNIK TELKOM TK3233.
Jartel, Sukiswo Sukiswo
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
EIS (Executive Information Systems)
MATRIX Concept of Matrix Matrik.
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Membangun Web Site“Cantik”
Dynamic Array and Linked List
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Technology And Engineering TECHNOLOGY AND ENGINERRING
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Kode Hamming.
KOMUNIKASI DATA S. Indriani L, M.T
Pengujian Hipotesis (I) Pertemuan 11
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Dasar-Dasar Pemrograman
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Transformasi.
VECTOR VECTOR IN PLANE.
Pertemuan 24 Teknik Searching
Two-and Three-Dimentional Motion (Kinematic)
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
TRANSFORMASI OBJEK (TRANSFORMASI AFFINE 2D DAN 3D)
FACTORING ALGEBRAIC EXPRESSIONS
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
EIS (Executive Information Systems)
Kk ilo Associative entity.
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
6. APLIKASI PRINSIP EKONOMI DALAM BISNIS; PRODUKSI
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Transformasi 3D Grafika Komputer Defiana Arnaldy, M.Si
Physics Quantities Vector Quanties Scalar Quantities Consist of.
Operasi Matriks Dani Suandi, M.Si..
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Algoritma & Pemrograman 1 Achmad Fitro The Power of PowerPoint – thepopp.com Chapter 4.
Spectacular Architecture
Al Muizzuddin F Matematika Ekonomi Lanjutan 2013
Politeknik Negeri Malang
Transcript presentasi:

COMPUTER GRAPHICS D10K-5C01 GK11: OpenGL Transformasi dan Interaksi Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Materi Memahami transformasi dalam OpenGL Memahami interaksi sederhana dalam openGL

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Matriks OpenGL Dalam OpenGL matriks adalah bagian proses Multiple types Model-View ( GL_MODELVIEW ) Projection ( GL_PROJECTION ) Texture ( GL_TEXTURE ) Color( GL_COLOR ) Perkakas untuk manipulasi objek Pemilihan cara manipulasi glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_PROJECTION);

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Current Transformation Matrix (CTM) Matriks transformasi homogen 4 x 4. CTMverteks p P’=Cp C

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Operasi CTM CTM diload ke sebuah variabel atau dioperasikan dengan perkalian matriks Load an identity matrix: C  I Load an arbitrary matrix: C  M Load a translation matrix: C  T Load a rotation matrix: C  R Load a scaling matrix: C  S Postmultiply by an arbitrary matrix: C  CM Postmultiply by a translation matrix: C  CT Postmultiply by a rotation matrix: C  C R Postmultiply by a scaling matrix: C  C S

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Rotasi dengan Pusat Rotasi Tetap (fixed point) Start with identity matrix: C  I Move fixed point to origin: C  CT Rotate by angle: C  CR Move fixed point back: C  CT -1 Result of post multiplications : C = TR T –1 Transformed points are calculated using p’=Cp Hence p’=( TR T –1 ) p which is backwards.

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Reversing the Order We want C = T –1 R T so we must do the operations in the following order C  I C  CT -1 C  CR C  CT Each operation corresponds to one function call in the program. Note that the last operation specified is the first executed in the program

GK11 Computer Graphics Teknik Informatika-Semester Ganjil CTM dalam OpenGL OpenGL has a model-view and a projection matrix in the pipeline which are concatenated together to form the CTM Can manipulate each by first setting the correct matrix mode

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Rotation, Translation, Scaling glRotatef(theta, vx, vy, vz) glTranslatef(dx, dy, dz) glScalef( sx, sy, sz) glLoadIdentity() Load an identity matrix: Multiply on right: theta in degrees, ( vx, vy, vz ) define axis of rotation Each has a float (f) and double (d) format ( glScaled )

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Contoh Rotation about z axis by 30 degrees with a fixed point of (1.0, 2.0, 3.0) Remember that last matrix specified in the program is the first applied glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(1.0, 2.0, 3.0); glRotatef(30.0, 0.0, 0.0, 1.0); glTranslatef(-1.0, -2.0, -3.0);

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Matriks Arbitrari Can load and multiply by matrices defined in the application program The matrix m is a one dimension array of 16 elements which are the components of the desired 4 x 4 matrix stored by columns In glMultMatrixf, m multiplies the existing matrix on the right glLoadMatrixf(m) glMultMatrixf(m)

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Matrix Stacks In many situations we want to save transformation matrices for use later Traversing hierarchical data structures (Chapter 10) Avoiding state changes when executing display lists OpenGL maintains stacks for each type of matrix Access present type (as set by glMatrixMode) by glPushMatrix() glPopMatrix()

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Reading Back Matrices Can also access matrices (and other parts of the state) by query functions For matrices, we use as glGetIntegerv glGetFloatv glGetBooleanv glGetDoublev glIsEnabled float m[16]; glGetFloatv(GL_MODELVIEW, m);

GK11 Computer Graphics Teknik Informatika-Semester Ganjil Penggunaan Transformasi Contoh: menggunakan idle function untuk merotasikan sebuah kubus 3D Interaksi fungsi mouse untuk mengubah arah rotasi

GK11 Computer Graphics Teknik Informatika-Semester Ganjil ColorCube.c

GK11 Computer Graphics Teknik Informatika-Semester Ganjil TUGAS 2 OPENGL Ambil program colorcube.c dan install-kan pada Visual Studio Modifikasi (enhance) program tersebut, cobalah fungsi-fungsi transformasi lainnya Gunakan kuriositas dan kreativitas anda Tuangkan dalam tulisan apa yang anda kerjakan dan submit hasilnya (dalam Word) ke e- Learning sebagai Tugas OpenGL2