Transformasi.

Slides:



Advertisements
Presentasi serupa
Pertemuan 03: Grafika Komputer: Windows dan Viewport
Advertisements

Praktikum Grafika Komputer
Lecture 2 Introduction to C# - Object Oriented Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Function.
Imam Cholissodin| 04 |Transformations Imam Cholissodin|
SUBPROGRAM IN PASCAL PROCEDURE Lecture 5 CS1023.
Lecture 5 Nonblocking I/O and Multiplexing Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
ARRAY RUBY. PENDAHULUAN Ruby's arrays are untyped and mutable. The elements of an array need not all be of the same class, and they can be changed at.
K-Map Using different rules and properties in Boolean algebra can simplify Boolean equations May involve many of rules / properties during simplification.
Eriq Muhammad Adams J | 04 |Transformation Eriq Muhammad Adams J |
Imam Cholissodin| 06 | Viewing / Camera Imam Cholissodin|
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.
The steps to work with Power Point click Start> All Programs> Microsoft Office> Microsoft Office PowerPoint2007 klik Start>All Programs>Microsoft.
Basic Konstruksi,Artikulasi & kesimbangan 01 Pertemuan 03 Matakuliah : UO646 / DKV III Tahun : 2009.
Universitas Jenderal Soedirman Purwokerto FISIKA DASAR II Oleh : Mukhtar Effendi.
Pertemuan 11 Interaksi User Diadaptasi dari paint.c E. Angel.
Bab 4 Tools untuk Menggambar : Window dan viewport
Praktikum 2.
Imam Cholissodin| 07 | Texture Mapping Imam Cholissodin|
PERTEMUAN KE-6 UNIFIED MODELLING LANGUAGE (UML) (Part 2)
Verb Tense Tense denotes the time of the action indicated by a verb. The time is not always the same as that indicated by the name of the tense.
Bayu Priyambadha, S.Kom.  Classes, which are the "blueprints" for an object and are the actual code that defines the properties and methods.  Objects,
COMPUTER GRAPHICS D10K-5C01 GK11: OpenGL Transformasi dan Interaksi Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas.
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.
Network Design (IP Address dan Subnetting). Tujuan Mengenal IP Address, bisa mengidentifikasinya dan bisa menggunakannya dalam membangun jaringan. Bisa.
How to fix/make sinking office chair reusable Post by:
A Detailed Knowledge About Reliable Porta Cabins Manufacturers.
Jartel, Sukiswo Sukiswo
Pertemuan 23 Sequence Diagram
Notasi Object Oriented System
G e o m e t r i F o t o U d a r a ?.
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
GEOMETRI SUDUT DAN BIDANG.
Cartesian coordinates in two dimensions
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Cartesian coordinates in two dimensions
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Pengujian Hipotesis (I) Pertemuan 11
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
ENGINEERING PLUMBING AND SANITATION
CLASS DIAGRAM.
Dasar-Dasar Pemrograman
FISIKA DASAR Pertemuan ke-3 Mukhtar Effendi.
Grafika Komputer Pengenalan Grafika Komputer &
Parabola Parabola.
VECTOR VECTOR IN PLANE.
BAB 4 Tools untuk Menggambar : Window dan viewport
PARADIGM SHIFT JATI SURYANTO S.PD., MA.
Two-and Three-Dimentional Motion (Kinematic)
Gerund (the -ing form) For example: Kita tidak bisa makan tanpa minum
REAL NUMBERS EKSPONENT NUMBERS.
TRANSFORMASI OBJEK (TRANSFORMASI AFFINE 2D DAN 3D)
Pertemuan 2 Pengantar Bahasa C dan Lingkungan Pemrograman Grafik dengan OpenGL Senin Wage, 28 September 2009.
Master data Management
Pertemuan 4 CLASS DIAGRAM.
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Magnitude and Vector Physics 1 By : Farev Mochamad Ihromi / 010
(Hepatitics Drug) Website:
How You Can Make Your Fleet Insurance London Claims Letter.
How Can I Be A Driver of The Month as I Am Working for Uber?
VCD102 - Gambar Desain Desain Komunikasi VIsual
Group 3 About causal Conjunction Member : 1. Ahmad Fandia R. S.(01) 2. Hesti Rahayu(13) 3. Intan Nuraini(16) 4. Putri Nur J. (27) Class: XI Science 5.
Lesson 2-1 Conditional Statements 1 Lesson 2-1 Conditional Statements.
DR. hill. gendoet hartono
Al Muizzuddin F Matematika Ekonomi Lanjutan 2013
Vector. A VECTOR can describe anything that has both MAGNITUDE and DIRECTION The MAGNITUDE describes the size of the vector. The DIRECTION tells you where.
TRANSFORMASI.
TRANSFORMASI & Flipping Coin
Draw a picture that shows where the knife, fork, spoon, and napkin are placed in a table setting.
Transcript presentasi:

Transformasi

Transformasi Grafika Komputer adalah proses transformasi dari model 3D obyek menjadi citra 2D, ini sama dengan analogi kamera. Sebelum memotret, apa yang dilakukan? melakukan pengesetan kamera dalam bentuk setting lensa kamera (zoom in/out) mengarahkan kamera ke obyek (ex: mengatur letak tripod) mengatur letak obyek (ex: mengubah-ubah letak objek) mengatur skala dan layout dari foto (ex : foto dengan orang di sisi pinggir)

Transformasi Analogi di atas merupakan penjelasan dari jenis-jenis transformasi sbb: melakukan pengesetan kamera dalam bentuk setting lensa kamera (Transformasi Proyeksi), mengarah kamera ke obyek (Transformasi Viewing), mengatur letak obyek (Transformasi Modeling), mengatur skala dan layout dari foto (Transformasi Viewport) -> dengan glViewPort pada contoh sebelumnya

Transformasi Proyeksi Digunakan untuk menentukan viewing volume. Dua macam Transf. proyeksi yaitu Perspektif dan Orthogonal Perspektif : objek yang jauh terlihat lebih kecil Orthogonal : maps objects directly onto the screen without affecting their relative size

Transformasi Proyeksi terdiri dari a Transformasi Proyeksi terdiri dari a. Transformasi Orthogonal/Paralel (gambar atas) b. Transformasi Perspektif (mengerucut ke satu titikproyeksi, gambar bawah)

Transformasi Viewing Untuk menghasilkan gambar, kamera perlu diletakkan pada posisi yang tepat didepan pemandangan yang diinginkan. Secara default, dalam OpenGL kemera akan berada pada posisi (0,0,0) dengan menghadap ke arah z = -1 dengan sumbu y mengarah ke atas kamera. Hal ini dapat dilakukan dengan menggunakan perintah gluLookAt() dengan didahului proses merubah status OpenGL ke modelview dengan perintah glMatrixMode(GL_MODELVIEW).

#include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> void init(void) { glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel (GL_FLAT); } void display(void) glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 1.0, 1.0); glLoadIdentity (); /* clear the matrix */ /* viewing transformation */ gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); glScalef (1.0, 2.0, 1.0); /* modeling transformation */ glutWireCube (1.0); glFlush (); void reshape (int w, int h) glViewport (0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode (GL_PROJECTION); glLoadIdentity (); glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0); glMatrixMode (GL_MODELVIEW); int main(int argc, char** argv) glutInit(&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (500, 500); glutInitWindowPosition (100, 100); glutCreateWindow (argv[0]); init (); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMainLoop(); return 0;

Viewing Transformation - gluLookAt() After the matrix is initialized, the viewing transformation is specified with gluLookAt(). The arguments for this command indicate where the camera (or eye position) is placed, where it is aimed, and which way is up. The arguments used here place the camera at (0, 0, 5), aim the camera lens towards (0, 0, 0), and specify the up-vector as (0, 1, 0). The up-vector defines a unique orientation for the camera. If gluLookAt() was not called, the camera has a default position and orientation. By default, the camera is situated at the origin, points down the negative z-axis, and has an up-vector of (0, 1, 0). 

Try This Change the gluLookAt() call in code to the modeling transformation glTranslatef() with parameters (0.0, 0.0, -5.0). The result should look exactly the same as when you used gluLookAt(). Why are the effects of these two commands similar?

GLU Quadrics gluQuadricTexture(GLUquadricObj *obj, Glboolean mode) OpenGL generates texture coordinates GL_FALSE: no texture coordinates (default) gluSphere(GLUquadricObj *obj, Gldouble radius, Glint slices, Glint stacks) creates a Sphere in the origin with the given radius gluCylinder(GLUquadricObj *obj, Gldouble base, Gldouble top,Gldouble height, Gldouble slices, Gldouble stacks) A centered cylinder with specified base and top radii glutWireSphere(Gldouble radius, Glint slices, Glint stacks) glutSolidSphere(Gldouble radius, Glint slices, Glint stacks) glutWire[Solid]Cone(Gldouble base, Gldouble height, Glint slices, Glint stacks) glutWire[Solid]Teapot (Gldouble size)

Modelling Transformation You use the modeling transformation to position and orient the model. For example, you can rotate, translate, or scale the model - or perform some combination of these operations. Example 3-1,glScalef() is the modeling transformation that is used. The arguments for this command specify how scaling should occur along the three axes. If all the arguments are 1.0, this command has no effect. In Example 3-1, the cube is drawn twice as large in the y direction. Thus, if one corner of the cube had originally been at (3.0, 3.0, 3.0), that corner would wind up being drawn at (3.0, 6.0, 3.0). The effect of this modeling transformation is to transform the cube so that it isn't a cube but a rectangular box.

Try This Change the gluLookAt() call in Example 3-1 to the modeling transformation glTranslatef() with parameters (0.0, 0.0, -5.0). The result should look exactly the same as when you usedgluLookAt(). Why are the effects of these two commands similar?

Viewport Transformation Together, the projection transformation and the viewport transformation determine how a scene gets mapped onto the computer screen. 

Tambahkan animasi rotasi pada objek kubus dan inputan keyboard untuk translasi pada sumbu z. Contoh coding pada pertemuan 2