Kamis, 19 November 2009

OPEN GL

OpenGL (Open G raphics L ibrary) adalah spesifikasi standar yang mendefinisikan sebuah cross-bahasa, lintas-platform API untuk menulis aplikasi yang menghasilkan 2D dan 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives . Antarmuka terdiri dari lebih dari 250 panggilan fungsi yang berbeda yang dapat digunakan untuk menggambar tiga dimensi yang kompleks adegan dari sederhana primitif. OpenGL was developed by Silicon Graphics Inc. (SGI) in 1992 [ 1 ] and is widely used in CAD , virtual reality , scientific visualization, information visualization, and flight simulation . OpenGL dikembangkan oleh Silicon Graphics Inc (SGI) pada tahun 1992 [1] dan secara luas digunakan dalam CAD, virtual reality, visualisasi ilmiah, visualisasi informasi, dan simulasi penerbangan. It is also used in video games , where it competes with Direct3D on Microsoft Windows platforms (see Direct3D vs. OpenGL ). Hal ini juga digunakan dalam video game, di mana bersaing dengan Direct3D on Microsoft Windows platform (lihat Direct3D vs OpenGL). OpenGL is managed by the non-profit technology consortium, the Khronos Group . OpenGL dikelola oleh teknologi nirlaba konsorsium, yang Khronos Group.

OpenGL melayani dua tujuan utama:

* To hide the complexities of interfacing with different 3D accelerators, by presenting the programmer with a single, uniform API. Untuk menyembunyikan kompleksitas berinteraksi dengan akselerator 3D yang berbeda, dengan menghadirkan para programmer dengan satu, seragam API.
* To hide the differing capabilities of hardware platforms, by requiring that all implementations support the full OpenGL feature set (using software emulation if necessary). Untuk menyembunyikan kemampuan yang berbeda platform perangkat keras, dengan mensyaratkan bahwa semua mendukung implementasi penuh fitur opengl set (menggunakan software emulasi jika perlu).

OpenGL's basic operation is to accept primitives such as points, lines and polygons, and convert them into pixels. Operasi dasar OpenGL adalah menerima primitif seperti titik, garis dan poligon, dan mengubahnya menjadi piksel. This is done by a graphics pipeline known as the OpenGL state machine . Hal ini dilakukan dengan sebuah pipa grafis yang dikenal sebagai mesin negara OpenGL. Most OpenGL commands either issue primitives to the graphics pipeline, or configure how the pipeline processes these primitives. Kebanyakan masalah baik perintah OpenGL primitif ke pipa grafis, atau mengkonfigurasi bagaimana proses pipa primitif ini. Prior to the introduction of OpenGL 2.0, each stage of the pipeline performed a fixed function and was configurable only within tight limits. Sebelum pengenalan OpenGL 2.0, setiap tahap pipa tetap melakukan fungsi dan dikonfigurasi hanya dalam batas ketat. OpenGL 2.0 offers several stages that are fully programmable using GLSL . OpenGL 2.0 menawarkan beberapa tahapan yang sepenuhnya diprogram menggunakan GLSL.

OpenGL is a low-level, procedural API, requiring the programmer to dictate the exact steps required to render a scene. OpenGL adalah tingkat rendah, prosedural API, yang memerlukan programmer untuk menentukan langkah-langkah yang tepat diperlukan untuk menampilkan sebuah adegan. This contrasts with descriptive (aka scene graph or retained mode ) APIs, where a programmer only needs to describe a scene and can let the library manage the details of rendering it. Hal ini berbeda dengan deskriptif (alias adegan grafik atau modus dipertahankan) API, di mana seorang programmer hanya perlu menggambarkan adegan dan dapat membiarkan mengelola perpustakaan rincian render itu. OpenGL's low-level design requires programmers to have a good knowledge of the graphics pipeline, but also gives a certain amount of freedom to implement novel rendering algorithms. OpenGL tingkat rendah desain membutuhkan programmer untuk memiliki pengetahuan yang baik dari pipa grafis, tapi juga memberikan sejumlah novel kebebasan untuk menerapkan algoritma rendering.

OpenGL has historically been influential on the development of 3D accelerators, promoting a base level of functionality that is now common in consumer-level hardware: OpenGL secara historis berpengaruh pada pengembangan akselerator 3D, mempromosikan tingkat dasar fungsionalitas yang sekarang umum di tingkat konsumen hardware:

* Rasterised points , lines and polygons as basic primitives Rasterised poin, garis dan poligon sebagai dasar primitif

* Sebuah mentransformasi dan pencahayaan pipa
* Z-buffering Z-buffering
* Texture mapping Texture mapping
* Alpha blending Alpha blending

A brief description of the process in the graphics pipeline could be: [ 2 ] Sebuah deskripsi singkat dari proses dalam pipa grafis dapat berupa: [2]

1. Evaluation, if necessary, of the polynomial functions which define certain inputs, like NURBS surfaces, approximating curves and the surface geometry. Evaluasi, jika perlu, dari fungsi polinom yang menentukan masukan tertentu, seperti NURBS permukaan, kurva mendekati permukaan dan geometri.
2. Vertex operations, transforming and lighting them depending on their material. Vertex operasi, mengubah dan pencahayaan mereka tergantung pada materi mereka. Also clipping non visible parts of the scene in order to produce the viewing volume. Kliping juga tidak terlihat bagian-bagian dari adegan dalam rangka untuk menghasilkan volume melihat.
3. Rasterisation or conversion of the previous information into pixels. Rasterisation atau konversi informasi sebelumnya ke dalam piksel. The polygons are represented by the appropriate colour by means of interpolation algorithms. Yang poligon yang diwakili oleh warna yang sesuai dengan menggunakan algoritma interpolasi.
4. Per-fragment operations, like updating values depending on incoming and previously stored depth values, or colour combinations, among others. Per-fragmen operasi, seperti nilai-nilai memperbarui masuk dan tergantung pada kedalaman tersimpan sebelumnya nilai-nilai, atau kombinasi warna, antara lain.
5. Lastly, fragments are inserted into the Frame buffer . Terakhir, fragmen dimasukkan ke dalam Frame buffer.

Many modern 3D accelerators provide functionality far above this baseline, but these new features are generally enhancements of this basic pipeline rather than radical revisions of it. Banyak akselerator 3D modern menyediakan fungsionalitas jauh di atas dasar ini, tetapi fitur baru ini umumnya perangkat tambahan pipa dasar ini bukan revisi radikal itu.



Contoh

This example will draw a green square on the screen. Contoh ini akan menarik sebuah persegi hijau di layar. OpenGL has several ways to accomplish this task, but this is the easiest to understand. OpenGL memiliki beberapa cara untuk menyelesaikan tugas ini, tapi ini adalah yang paling mudah untuk memahami. However, the reader should be aware that most of the APIs used in the code below have been deprecated in and after the OpenGL 3.0 specification. Namun, pembaca harus menyadari bahwa sebagian besar API yang digunakan dalam kode di bawah ini telah usang dalam dan setelah 3,0 spesifikasi OpenGL.

glClear ( GL_COLOR_BUFFER_BIT ) ; glClear (GL_COLOR_BUFFER_BIT);

This statement clears the color buffer, so that the screen will start blank. Pernyataan ini membersihkan buffer warna, sehingga layar akan mulai kosong.

glMatrixMode ( GL_PROJECTION ) ; /* Subsequent matrix commands will affect the projection matrix */ glMatrixMode (GL_PROJECTION); / * matriks perintah berikutnya akan mempengaruhi proyeksi matriks * /
glLoadIdentity ( ) ; /* Initialise the projection matrix to identity */ glLoadIdentity (); / * menginisialisasinya matriks proyeksi identitas * /
glFrustum ( - 1 , 1 , - 1 , 1 , 1 , 1000 ) ; /* Apply a perspective-projection matrix */ glFrustum (- 1, 1, - 1, 1, 1, 1000); / * Oleskan proyeksi perspektif-matriks * /

These statements initialize the projection matrix, setting a 3d frustum matrix that represents the viewable area. Pernyataan-pernyataan ini menginisialisasi matriks proyeksi, menetapkan 3d frustum matriks yang mewakili daerah dilihat. This matrix transforms objects from camera-relative space to OpenGL's projection space. Matriks ini mengubah objek dari kamera-ruang relatif ke OpenGL ruang proyeksi.

glMatrixMode ( GL_MODELVIEW ) ; /* Subsequent matrix commands will affect the modelview matrix */ glMatrixMode (GL_MODELVIEW); / * matriks perintah berikutnya akan mempengaruhi matriks modelview * /
glLoadIdentity ( ) ; /* Initialise the modelview to identity */ glLoadIdentity (); / * menginisialisasinya yang modelview identitas * /
glTranslatef ( 0 , 0 , - 3 ) ; /* Translate the modelview 3 units along the Z axis */ glTranslatef (0, 0, - 3); / * Terjemahkan modelview 3 unit sepanjang sumbu Z * /

These statements initialize the modelview matrix. Pernyataan-pernyataan ini menginisialisasi matriks modelview. This matrix defines a transform from model-relative coordinates to camera space. Matriks ini mendefinisikan sebuah transformasi dari model-koordinat kamera relatif ruang. The combination of the modelview matrix and the projection matrix transforms objects from model-relative space to projection screen space. Kombinasi dari modelview matriks dan matriks transformasi proyeksi objek dari model-relatif ruang untuk layar proyeksi ruang.

glBegin ( GL_POLYGON ) ; /* Begin issuing a polygon */ glBegin (GL_POLYGON); / * Mulailah mengeluarkan poligon * /
glColor3f ( 0 , 1 , 0 ) ; /* Set the current color to green */ glColor3f (0, 1, 0); / * Mengatur warna hijau saat ini * /
glVertex3f ( - 1 , - 1 , 0 ) ; /* Issue a vertex */ glVertex3f (- 1, - 1, 0); / * Terbitan sebuah sudut * /
glVertex3f ( - 1 , 1 , 0 ) ; /* Issue a vertex */ glVertex3f (- 1, 1, 0); / * Terbitan sebuah sudut * /
glVertex3f ( 1 , 1 , 0 ) ; /* Issue a vertex */ glVertex3f (1, 1, 0); / * Terbitan sebuah sudut * /
glVertex3f ( 1 , - 1 , 0 ) ; /* Issue a vertex */ glVertex3f (1, - 1, 0); / * Terbitan sebuah sudut * /
glEnd ( ) ; /* Finish issuing the polygon */ Glend (); / * Selesai mengeluarkan poligon * /


Tinggi fungsionalitas tingkat

OpenGL was designed to be graphic output-only: it provides only rendering functions. OpenGL ini dirancang untuk menjadi output grafis hanya: hanya menyediakan render fungsi. The core API has no concept of windowing systems , audio, printing to the screen, keyboard/mouse or other input devices . API inti tidak memiliki konsep sistem windowing, audio, mencetak ke layar, keyboard / mouse atau perangkat input. While this seems restrictive at first, it allows the code that does the rendering to be completely independent of the operating system it is running on, allowing cross-platform development. Walaupun program ini tampaknya terbatas pada awalnya, hal itu memungkinkan kode yang melakukan penyerahan harus benar-benar tergantung pada sistem operasi ini berjalan pada, memungkinkan pengembangan lintas-platform. However, some integration with the native windowing system is required to allow clean interaction with the host system. Namun, beberapa integrasi dengan sistem windowing asli diperlukan untuk memungkinkan interaksi bersih dengan sistem host. This is performed through the following add-on APIs: Hal ini dilakukan melalui add-on berikut API:

* GLX – X11 (including network transparency ) GLX - X11 (termasuk transparansi jaringan)
* WGL – Microsoft Windows WGL - Microsoft Windows
* CGL – Mac OS X . Better integration with Mac OS X's application frameworks is provided by APIs layered on top of CGL: AGL for Carbon and NSOpenGL for Cocoa . CGL - Mac OS X. Lebih baik integrasi dengan Mac OS X kerangka kerja aplikasi ini disediakan oleh API berlapis-lapis di atas CGL: AGL untuk Karbon dan NSOpenGL untuk Kakao.

Additionally, GLUT , SDL and the GLFW libraries provide functionality for basic windowing using OpenGL, in a portable manner. Selain itu, GLUT, SDL dan GLFW perpustakaan menyediakan fungsionalitas untuk windowing dasar menggunakan OpenGL, dalam cara portabel.

Some open source cross-platform toolkits, such as GTK+ , Qt and WxWidgets , include widgets to embed OpenGL contents. Beberapa open source cross-platform toolkit, seperti GTK +, Qt dan wxWidgets, termasuk widget untuk menanamkan OpenGL isinya.
[ edit ] History [Sunting] Sejarah

In the 1980s, developing software that could function with a wide range of graphics hardware was a real challenge. Tahun 1980-an, mengembangkan perangkat lunak yang dapat berfungsi dengan berbagai hardware grafis adalah tantangan nyata. Software developers wrote custom interfaces and drivers for each piece of hardware. Pengembang perangkat lunak antarmuka dan kebiasaan menulis driver untuk setiap perangkat keras. This was expensive and resulted in much duplication of effort. Ini mahal dan mengakibatkan banyak duplikasi usaha.

By the early 1990s, Silicon Graphics (SGI) was a leader in 3D graphics for workstations. Pada awal 1990-an, Silicon Graphics (SGI) adalah seorang pemimpin dalam grafis 3D untuk workstation. Their IRIS GL API [ 6 ] was considered the state of the art and became the de facto industry standard, overshadowing the open standards-based PHIGS . Mereka IRIS GL API [6] dianggap keadaan seni dan menjadi standar industri de facto, membayangi terbuka berbasis standar PHIGS. This was because IRIS GL was considered easier to use, and because it supported immediate mode rendering. Ini karena GL IRIS dianggap lebih mudah digunakan, dan karena itu mendukung modus langsung rendering. By contrast, PHIGS was considered difficult to use and outdated in terms of functionality. Sebaliknya, PHIGS dianggap sulit untuk digunakan dan ketinggalan zaman dalam hal fungsionalitas.

SGI's competitors (including Sun Microsystems , Hewlett-Packard and IBM ) were also able to bring to market 3D hardware, supported by extensions made to the PHIGS standard. SGI's pesaing (termasuk Sun Microsystems, Hewlett-Packard dan IBM) juga dapat membawa ke pasar 3D hardware, didukung oleh ekstensi yang dibuat pada PHIGS standar. This in turn caused SGI market share to weaken as more 3D graphics hardware suppliers entered the market. Hal ini pada gilirannya menyebabkan pangsa pasar SGI untuk melemahkan karena lebih banyak hardware grafis 3D pemasok memasuki pasar. In an effort to influence the market, SGI decided to turn the IrisGL API into an open standard. Dalam upaya untuk mempengaruhi pasar, SGI memutuskan untuk mengubah IrisGL API menjadi standar terbuka.

SGI considered that the IrisGL API itself wasn't suitable for opening due to licensing and patent issues. SGI menganggap bahwa IrisGL API itu sendiri tidak cocok untuk membuka karena masalah lisensi dan paten. Also, the IrisGL had API functions that were not relevant to 3D graphics. Juga, IrisGL memiliki fungsi-fungsi API yang tidak relevan dengan grafis 3D. For example, it included a windowing, keyboard and mouse API, in part because it was developed before the X Window System and Sun's NeWS systems were developed. Sebagai contoh, termasuk windowing, keyboard dan mouse API, sebagian karena dikembangkan sebelum Sistem X Window dan Sun's NEWS sistem dikembangkan.

In addition, SGI had a large number of software customers; by changing to the OpenGL API they planned to keep their customers locked onto SGI (and IBM) hardware for a few years while market support for OpenGL matured. Selain itu, SGI memiliki sejumlah besar pelanggan perangkat lunak; dengan mengubah ke OpenGL API mereka berencana untuk mempertahankan pelanggan mereka terkunci ke SGI (dan IBM) hardware untuk beberapa tahun sementara pasar dukungan untuk OpenGL matang. Meanwhile, SGI would continue to try to maintain their customers tied to SGI hardware by developing the advanced and proprietary Iris Inventor and Iris Performer programming APIs. Sementara itu, SGI akan terus berusaha untuk mempertahankan pelanggan mereka terikat pada hardware SGI dengan mengembangkan maju dan kepemilikan Iris Inventor dan Iris Performer pemrograman API.

As a result, SGI released the OpenGL standard. Akibatnya, SGI merilis standar OpenGL.

The OpenGL standardised access to hardware, and pushed the development responsibility of hardware interface programs, sometimes called device drivers , to hardware manufacturers and delegated windowing functions to the underlying operating system. Akses standar yang OpenGL hardware, dan mendorong tanggung jawab pengembangan program antarmuka perangkat keras, kadang-kadang disebut device driver, hardware produsen dan windowing didelegasikan fungsinya kepada sistem operasi. With so many different kinds of graphic hardware, getting them all to speak the same language in this way had a remarkable impact by giving software developers a higher level platform for 3D-software development. Dengan begitu banyak jenis perangkat keras grafis, membuat mereka semua berbicara dengan bahasa yang sama dengan cara ini mempunyai dampak luar biasa dengan memberikan pengembang perangkat lunak tingkat yang lebih tinggi 3D-platform untuk pengembangan perangkat lunak.

In 1992, [ 7 ] SGI led the creation of the OpenGL architectural review board (OpenGL ARB), the group of companies that would maintain and expand the OpenGL specification for years to come. Pada tahun 1992, [7] SGI memimpin pembentukan dewan peninjau arsitektur OpenGL (OpenGL ARB), kelompok perusahaan yang akan memelihara dan memperluas spesifikasi OpenGL selama bertahun-tahun yang akan datang. OpenGL evolved from (and is very similar in style to) SGI's earlier 3D interface, IrisGL . OpenGL berevolusi dari (dan sangat mirip dengan) SGI sebelumnya antarmuka 3D, IrisGL. One of the restrictions of IrisGL was that it only provided access to features supported by the underlying hardware. Salah satu batasan dari IrisGL adalah bahwa ia hanya memberikan akses ke fitur yang didukung oleh hardware yang mendasarinya. If the graphics hardware did not support a feature, then the application could not use it. Jika hardware grafis tidak mendukung fitur, maka aplikasi tidak bisa menggunakannya. OpenGL overcame this problem by providing support in software for features unsupported by hardware, allowing applications to use advanced graphics on relatively low-powered systems. OpenGL mengatasi masalah ini dengan menyediakan dukungan perangkat lunak untuk fitur yang tidak didukung oleh hardware, memungkinkan aplikasi untuk menggunakan gambar pada lanjutan relatif rendah sistem bertenaga.

In 1994 SGI played with the idea of releasing something called " OpenGL++ " which included elements such as a scene-graph API (presumably based around their Performer technology). Tahun 1994 SGI bermain-main dengan gagasan untuk melepaskan sesuatu yang disebut "OpenGL + +" yang mencakup unsur-unsur seperti grafik adegan-API (mungkin berbasis di sekitar mereka Performer teknologi). The specification was circulated among a few interested parties – but never turned into a product. [ 8 ] Spesifikasi itu beredar di kalangan beberapa pihak yang berkepentingan - tetapi tidak pernah berubah menjadi sebuah produk. [8]

Microsoft released Direct3D in 1995, which would become the main competitor of OpenGL. Microsoft dirilis Direct3D pada tahun 1995, yang akan menjadi pesaing utama dari OpenGL. On 17 December 1997 [ 9 ] , Microsoft and SGI initiated the Fahrenheit project, which was a joint effort with the goal of unifying the OpenGL and Direct3D interfaces (and adding a scene-graph API too). Pada tanggal 17 Desember 1997 [9], Microsoft dan SGI memprakarsai Fahrenheit proyek, yang merupakan upaya bersama dengan tujuan mempersatukan OpenGL dan Direct3D antarmuka (dan menambahkan adegan-API grafik juga). In 1998 Hewlett-Packard joined the project. [ 10 ] It initially showed some promise of bringing order to the world of interactive 3D computer graphics APIs, but on account of financial constraints at SGI, strategic reasons at Microsoft, and general lack of industry support, it was abandoned in 1999. [ 11 ] Pada tahun 1998 Hewlett-Packard bergabung dengan proyek ini. [10] Ini awalnya menunjukkan beberapa janji untuk membawa dunia komputer grafis 3D interaktif API, melainkan karena kendala keuangan di SGI, alasan strategis di Microsoft, dan kurangnya dukungan industri , itu ditinggalkan pada tahun 1999. [11]


DAFTAR PUSTAKA:
http://en.wikipedia.org/wiki/OpenGL