Pindah-rata-lingkaran-penyangga

Pindah-rata-lingkaran-penyangga

Strategi perdagangan spekulatif
Bagaimana-untuk-menggunakan-karyawan-saham-pilihan
Timberwolves-pilihan perdagangan


Options-trading-margin-account Indikator forex-trader profesional Stock-options-trading-tips-in-india Option-trading-hidden-reality M2-forex-ru The-new-commodity-trading-systems-and-methods-pdf

Silabus JEE JEE Matematika Silabus Aljabar bilangan kompleks, penambahan, perkalian, konjugasi, representasi polar, sifat modulus dan argumen pokok, ketimpangan segitiga, akar kubus persatuan, interpretasi geometris. Persamaan kuadrat dengan koefisien nyata, hubungan antara akar dan koefisien, pembentukan persamaan kuadrat dengan akar yang diberikan, fungsi simetris akar. Aritmetika, progresi geometrik dan harmonik, aritmatika, geometris dan harmonik, jumlah aritmatika dan progresif aritmatika yang terbatas, deret geometri tak terbatas, jumlah kotak dan kubus dari bilangan natural n pertama. Logaritma dan propertinya. Permutasi dan kombinasi, teorema Binomial untuk indeks integral positif, sifat koefisien binomial. Matriks sebagai rangkaian bilangan real persegi, persamaan matriks, penambahan, perkalian dengan skalar dan produk matriks, transpos matriks, determinan matriks kuadrat pesanan hingga tiga, kebalikan dari matriks kuadrat pesanan sampai tiga , Sifat dari operasi matriks, diagonal, simetris dan matriks simetris miring dan propertinya, solusi persamaan linier simultan dalam dua atau tiga variabel. Aturan penambahan dan perkalian probabilitas, probabilitas bersyarat, independensi kejadian, perhitungan probabilitas kejadian dengan menggunakan permutasi dan kombinasi. Fungsi trigonometri, periodisitas dan grafiknya, formula penambahan dan pengurangan, formula yang melibatkan banyak dan sub-multiple angle, solusi umum persamaan trigonometri. Hubungan antara sisi dan sudut segitiga, aturan sinus, aturan kosinus, rumus setengah sudut dan luas segitiga, fungsi trigonometri terbalik (hanya nilai utama). Dua dimensi. Koordinat Cartesian, jarak antara dua titik, rumus bagian, pergeseran asal. Persamaan garis lurus dalam berbagai bentuk, sudut antara dua garis, jarak titik dari garis. Garis melalui titik persimpangan dua garis yang diberikan, persamaan garis sudut antara dua garis, garis konkurensi, centroid, orthocentre, incentre dan circumcentre segitiga. Persamaan lingkaran dalam berbagai bentuk, persamaan tangen, normal dan akord. Persamaan parametrik dari lingkaran, persimpangan lingkaran dengan garis lurus atau lingkaran, persamaan lingkaran melalui titik persimpangan dua lingkaran dan lingkaran dan garis lurus. Persamaan parabola, elips dan hiperbola dalam bentuk standar, fokus, directrices dan eksentrisitas, persamaan parametrik, persamaan singgung dan normal. Tiga dimensi. Rasio kosinus arah dan arah, persamaan garis lurus di ruang angkasa, persamaan bidang, jarak titik dari bidang. Fungsi bernilai riil dari variabel nyata, ke dalam, ke dan fungsi satu lawan satu, jumlah, perbedaan, produk dan hasil bagi dua fungsi, fungsi komposit, fungsi nilai absolut, polinomial, rasional, trigonometri, eksponensial dan logaritmik. Batasan dan kontinuitas suatu fungsi, batas dan kontinuitas jumlah, perbedaan, produk dan hasil bagi dua fungsi, peraturan lHospital evaluasi batas fungsi. Bahkan dan fungsi ganjil, kebalikan dari fungsi, kontinuitas fungsi komposit, properti nilai menengah fungsi kontinyu. Derivatif fungsi, turunan dari jumlah, perbedaan, produk dan hasil bagi dua fungsi, aturan rantai, derivatif fungsi polinomial, rasional, trigonometri, invers trigonometri, eksponensial dan logaritmik. Derivatif fungsi implisit, derivatif sampai urutan dua, interpretasi geometrik derivatif, garis singgung dan normalnya, peningkatan dan penurunan fungsi, nilai maksimum dan minimum suatu fungsi, penerapan Teorema Rolles Teorema dan Lagranges Mean Value. Integrasi sebagai proses diferensiasi terbalik, integral tak tentu fungsi standar, integral pasti dan propertinya, penerapan Teorema Fundamental Kalkulus Integral. Integrasi oleh bagian, integrasi dengan metode substitusi parsial dan parsial, penerapan integral tertentu untuk penentuan area yang melibatkan kurva sederhana. Pembentukan persamaan diferensial biasa, larutan persamaan diferensial homogen, metode variabel yang dapat dipisahkan, persamaan diferensial orde pertama linier. Penambahan vektor, perkalian skalar, produk skalar, produk titik dan silang, tiga produk skalar dan interpretasi geometrisnya. JEE Kimia Silabus topik Umum. Konsep atom dan molekul Teori atom Dalton Konsep mol Rumus kimia Persamaan kimia yang seimbang Perhitungan (berdasarkan konsep mol) yang melibatkan reaksi oksidasi, reduksi, netralisasi, dan perpindahan oksidasi umum Konsentrasi dalam hal fraksi mol, molaritas, molalitas dan normalitas. Negara gas dan cair. Skala absolut suhu, persamaan gas ideal Penyimpangan dari idealitas, persamaan van der Waals Kinetika teori gas, rata-rata, rata-rata akar kuadrat dan kecepatan yang paling mungkin dan hubungannya dengan suhu Hukum tekanan parsial Tekanan uap Difusi gas. Struktur atom dan ikatan kimia: Model Bohr, spektrum atom hidrogen, bilangan kuantum Dualitas gelombang-partikel, hipotesis de Broglie Prinsip ketidakpastian Gambaran mekanik kuantum atom hidrogen (perlakuan kualitatif), bentuk orbital s, p dan d Konfigurasi elemen elektronik Sampai nomor atom 36) Prinsip aufbau Prinsip pengecualian Paulis dan aturan Hunds Orbital tumpang tindih dan ikatan kovalen Hibridisasi yang melibatkan orbital s, p dan d hanya Diagram energi orbit untuk spesies diatomik homonuklir Ikatan hidrogen Polaritas dalam molekul, momen dipol (hanya aspek kualitatif) Model VSEPR Dan bentuk molekul (linier, sudut, segitiga, planar persegi, piramida, piramidal persegi, trigonal bipiramidal, tetrahedral dan oktahedral). Energetika Hukum pertama termodinamika Energi internal, kerja dan panas, kerja dengan tekanan-volume Enthalpy, hukum Hess Panas reaksi, fusi dan vapourization Hukum kedua termodinamika Entropi Energi bebas Kriteria spontanitas. Keseimbangan kimia. Hukum tindakan massa Konstanta kesetimbangan, prinsip Le Chateliers (efek konsentrasi, suhu dan tekanan) Signifikansi DG dan DGo dalam kesetimbangan kimia Produk kelarutan, efek ion umum, larutan pH dan buffer Asam dan basa (konsep Bronsted dan Lewis) Hidrolisis garam . Elektrokimia Sel elektrokimia dan reaksi sel Potensi elektroda Persamaan nernst dan hubungannya dengan seri DG Electrochemical, ggl sel galvanis Hukum elektrolisis arus konduktansi elektrolit, konduktansi elektrolit, spesifik, ekuivalen dan molar, sel Kohar Kohlrauschs Concentration. Kinetika kimia Tingkat reaksi kimia Orde reaksi Tingkat konstan Reaksi orde pertama Ketergantungan suhu konstanta laju (persamaan Arrhenius). Solid state Klasifikasi padatan, keadaan kristal, tujuh sistem kristal (parameter sel a, b, c, a, b, g), struktur padat padat padat (kubik), kemasan dalam kisi fcc, bcc dan hcp Tetangga terdekat, jari-jari ionik, sederhana Senyawa ionik, titik cacat. Solusi . Hukum Raoults Penentuan berat molekul dari penurunan tekanan uap, elevasi titik didih dan titik beku titik beku. Kimia permukaan Konsep dasar adsorpsi (tidak termasuk isoterm adsorpsi) Koloid: jenis, metode sediaan dan sifat umum Ide dasar emulsi, surfaktan dan misel (hanya definisi dan contoh). Kimia nuklir Radioaktivitas: isotop dan isobars Sifat a, b dan g ray Kinetika peluruhan radioaktif (seri peluruhan tidak termasuk), penanggalan karbon Kestabilan inti sehubungan dengan rasio neutron proton Diskusi singkat mengenai reaksi fisi dan fusi. Isolasipreparasi dan sifat-sifat non-logam berikut. Boron, silikon, nitrogen, fosfor, oksigen, belerang dan halogens Sifat alotrop karbon (hanya berlian dan grafit), fosfor dan belerang. Persiapan dan sifat senyawa berikut: Oksida, peroksida, hidroksida, karbonat, bikarbonat, klorida dan sulfat natrium, kalium, magnesium dan kalsium Boron. Diborane, asam borat dan boraks Aluminium: alumina, aluminium klorida dan alium Karbon: oksida dan asam oksida (asam karbonat) Silikon: silikon, silikat dan silikon karbida Nitrogen: oksida, oxyacida dan amonia Fosfor: oksida, oxyacids (asam fosfor, asam fosfat) Dan fosfin Oksigen: ozon dan hidrogen peroksida Sulfur: hidrogen sulfida, oksida, asam sulfur, asam sulfat dan natrium tiosulfat Halogen: asam hidroksi, oksida dan oksias klorin, bubuk pemutih Xenon fluorida Pupuk: jenis NPK yang tersedia secara komersial (umum). Elemen transisi (seri 3d). Definisi, karakteristik umum, keadaan oksidasi dan stabilitasnya, warna (tidak termasuk rincian transisi elektronik) dan perhitungan momen magnetik spin-only Senyawa koordinasi: nomenklatur senyawa koordinasi mononuklir, isomerisasi cis-trans dan ionisasi, hibridisasi dan geometri koordinasi mononuklear Senyawa (linier, tetrahedral, planar persegi dan oktahedral). Persiapan dan sifat senyawa berikut. Oksida dan klorida timah dan timbal Oksida, klorida dan sulfat Fe2, Cu2 dan Zn2 ‚Äč‚ÄčKalium permanganat, kalium dikromat, perak oksida, perak nitrat, tiiosulfat perak. Bijih dan mineral. Bijih dan mineral besi, tembaga, timah, timbal, magnesium, aluminium, seng dan perak biasa terjadi. Metalurgi ekstraktif Prinsip-prinsip kimia dan reaksi saja (rincian industri tidak termasuk) Metode reduksi karbon (besi dan timah) Metode reduksi sendiri (tembaga dan timah) Metode reduksi elektrolit (magnesium dan aluminium) Proses sianida (perak dan emas). Prinsip analisis kualitatif. Kelompok I sampai V (hanya Ag, Hg2, Cu2, Pb2, Bi3, Fe3, Cr3, Al3, Ca2, Ba2, Zn2, Mn2 dan Mg2) Nitrat, halida (tidak termasuk fluoride), sulfat, sulfida dan sulfit. Konsep. Hibridisasi karbon Sigma dan pi-ikatan Bentuk molekul Isomer struktur dan geometrik Isomer optik dari senyawa yang mengandung hingga dua pusat asimetris, nomenklatur I, R (nomenklatur IUPAC) nomenklatur sederhana dari senyawa organik sederhana (hanya hidrokarbon, mono-fungsional Dan senyawa bi-fungsional) Konformasi etana dan butana (proyeksi Newman) Resonansi dan hyperconjugation Keto-enol tautomerisme Penentuan rumus empiris dan molekul senyawa sederhana (hanya metode pembakaran) Ikatan hidrogen: definisi dan pengaruhnya terhadap sifat fisik alkohol dan karboksilat Asam Efek induktif dan resonansi pada keasaman dan keasaman asam organik dan basa Polaritas dan efek induktif pada alkil halida Intermediet reaktif yang dihasilkan selama pembelahan ikatan homolitik dan heterolitik Pembentukan, struktur dan stabilitas karbokation, karbansi dan radikal bebas. Persiapan, sifat dan reaksi alkana. Seri homolog, sifat fisik alkana (titik leleh, titik didih dan kerapatan) Pembakaran dan halogenasi alkana Penyiapan alkana dengan reaksi reaksi dan reaksi dekarboksilasi Wurtz. Persiapan, sifat dan reaksi alkena dan alkal. Sifat fisik alkena dan alkal (titik didih, kerapatan dan momen dipol) Keasaman alkal Asam hidrat dikatalisis hidrasi alkena dan alkal (tidak termasuk stereokimia penambahan dan eliminasi) Reaksi alkena dengan KMnO4 dan ozon Pengurangan alkena dan alkin Pembuatan alkena dan Alkalin dengan reaksi eliminasi Reaksi penambahan elektrofilik dari alkena dengan X2, HX, HOX dan H2O (Xhalogen) Reaksi penambahan logam alkal asetil asetil. Reaksi benzena. Struktur dan aromatik Reaksi substitusi elektrofilik: halogenasi, nitrasi, sulfonasi, alkilasi Friedel-Crafts dan asilasi Efek kelompok o-, m dan p-directing di benzenes monosubstitusi. Phenols. Keasaman, reaksi substitusi elektrofilik (halogenasi, nitrasi dan sulfonasi) Reaksi Reimer-Tieman, reaksi Kolbe. Reaksi karakteristik dari berikut (termasuk yang disebutkan di atas). Alkil halida: reaksi penataan kembali karbokation alkil, reaksi Grignard, reaksi substitusi nukleofilik Alkohol: esterifikasi, dehidrasi dan oksidasi, reaksi natrium, fosfor halida, ZnCl2conc.-HCl, konversi alkohol menjadi aldehid dan keton Aldehida dan Keton: oksidasi, reduksi, Oksim dan hidrazon pembentukan aldol kondensasi, reaksi Perkin Cannizzaro reaksi haloform reaksi dan reaksi penambahan nukleofilik (Grignard Selain itu) Asam karboksilat: pembentukan ester, klorida asam dan amida, hidrolisis ester Amin: dasar anilina tersubstitusi dan amina alifatik, persiapan dari senyawa nitro, Reaksi dengan asam nitrat, reaksi penggandengan azo garam diazonium amina aromatik, Sandmeyer dan reaksi terkait reaksi besiium garam diazonium Haloarenes: substitusi aromatik nukleofilik pada haloarenes dan haloaren tersubstitusi - (tidak termasuk mekanisme Benzyne dan substitusi Cine). Karbohidrat Klasifikasi mono dan di-sakarida (glukosa dan sukrosa) Oksidasi, reduksi, pembentukan glikosida dan hidrolisis sukrosa. Asam amino dan peptida. Struktur umum (hanya struktur primer untuk peptida) dan sifat fisik. Properti dan penggunaan beberapa polimer penting. Karet alam, selulosa, nilon, teflon dan PVC. Praktis kimia organik. Deteksi unsur-unsur (N, S, halogen) Deteksi dan identifikasi kelompok fungsional berikut: hidroksil (alkohol dan fenolik), karbonil (aldehid dan keton), karboksil, amino dan nitro Metode kimia pemisahan senyawa organik mono-fungsional dari biner Campuran. JEE Physics Silabus Umum. Unit dan dimensi, analisis dimensi paling sedikit dihitung, angka signifikan Metode analisis pengukuran dan kesalahan untuk jumlah fisik yang berkaitan dengan percobaan berikut: Percobaan berdasarkan penggunaan kaliper vernier dan alat pengukur sekrup (mikrometer), Penentuan g menggunakan pendulum sederhana, modulus Youngs oleh Searles Metode, panas spesifik cairan dengan menggunakan kalorimeter, panjang fokus cermin cekung dan lensa cembung dengan menggunakan metode uv, Kecepatan suara menggunakan kolom resonansi, Verifikasi hukum Ohms menggunakan voltmeter dan ammeter, dan hambatan spesifik dari bahan kawat yang menggunakan Meter jembatan dan kotak pos. Mekanika. Kinematika dalam satu dan dua dimensi (koordinat Cartesian saja), proyektil Gerakan melingkar (seragam dan tidak seragam) Relatif kecepatan. Newton undang-undang gerak Kerangka acuan inersia dan seragam dipercepat Gesekan statis dan dinamik Kinetik dan energi potensial Kerja dan kekuasaan Pelestarian momentum linier dan energi mekanis. Sistem partikel Pusat massa dan gerakannya Impulse tabrakan elastik dan inelastis. Hukum gravitasi Potensi gravitasi dan medan Akselerasi akibat gravitasi Gerak planet dan satelit dalam orbit melingkar. Tubuh kaku, momen inersia, sumbu sumbu sejajar dan tegak lurus, momen inersia benda seragam dengan bentuk geometris sederhana Momentum sudut Torsi Konservasi momentum sudut Dinamika tubuh kaku dengan sumbu rotasi tetap Bergulir tanpa tergelincir cincin, silinder dan bola Keseimbangan Tubuh kaku Tabrakan massa titik dengan benda kaku. Gerakan harmonis linier dan sudut sederhana. Hukum Hookes, modulus Youngs. Tekanan dalam hukum Pascal fluida Pelepasan Energi permukaan dan tegangan permukaan, kenaikan kapiler Viskositas (persamaan Poiseuilles dikecualikan), statistik Stokes Terminal, aliran Streamline, Persamaan kontinuitas, teorema Bernoullis dan aplikasinya. Gelombang gerak (hanya gelombang pesawat), gelombang longitudinal dan transversal, Superposisi gelombang gelombang progresif dan stasioner Getaran senar dan kolom udara. Resonance Beats Kecepatan suara dalam efek gas Doppler (dalam suara). Fisika termal Ekspansi termal padatan, cairan dan gas Kalorimetri, panas laten Konduksi panas dalam satu dimensi Konsep dasar konveksi dan radiasi Newton hukum pendinginan Hukum gas ideal Pemanasan khusus (Cv dan Cp untuk gas monatomik dan diatomik) Proses isotermal dan adiabatik, modulus bulk Gas Equivalensi panas dan kerja Hukum pertama termodinamika dan aplikasinya (hanya untuk gas ideal). Radiasi blackbody: kekuatan penyerapan dan emosif Hukum Kirchhoff, hukum perpindahan Wiens, hukum Stefans. Listrik dan magnet. Hukum Coulomb Medan listrik dan potensial Potensi Listrik dari sistem muatan titik dan dipol listrik di bidang elektrostatik yang seragam, Garis medan listrik Flux dari hukum Gausss medan listrik dan aplikasinya dalam kasus sederhana, seperti, untuk menemukan lapangan karena tak terbatas Kawat lurus panjang, lembaran pesawat tak berhingga yang seragam dan cangkang bulat tipis yang dilumasi secara merata. Kapasitansi kapasitor pelat paralel dengan dan tanpa kapasitor dielektrik secara seri dan paralel Energi tersimpan dalam kapasitor. Arus listrik: Seri hukum Ohm dan pengaturan resistensi dan sel paralel Hukum Kirchhoff dan aplikasi sederhana Pemanasan efek arus. Hukum biot-Savart dan hukum Amperes, medan magnet di dekat kawat lurus saat ini, di sepanjang sumbu koil melingkar dan di dalam solenoid lurus lurus Gaya pada muatan bergerak dan pada kawat pembawa arus di medan magnet seragam. Momen magnetik dari loop arus Pengaruh medan magnet seragam pada loop arus Turunan kumparan galvanometer, voltmeter, ammeter dan konversi mereka. Induksi elektromagnetik Hukum saat ini, hukum Lenzs Self dan saling induktansi RC, LR dan LC sirkuit dengan d.c. Dan a.c. Sumber. Optik. Perambatan rectilinear cahaya Refleksi dan pembiasan pada permukaan bidang dan bola Total pantulan internal Penyimpangan dan dispersi cahaya oleh prisma Lensa tipis Kombinasi cermin dan lensa tipis Pembesaran. Sifat gelombang cahaya. Prinsip Huygens, gangguan terbatas pada percobaan double-slit Young. Fisika modern Inti atom Radiasi Alpha, beta dan gamma Hukum peluruhan radioaktif Konstanta peluruhan Kehidupan paruh waktu dan rata-rata Energi pengikat dan penghitungannya Proses fisi dan fusi Perhitungan energi dalam proses ini. Efek fotolistrik Teori Bohrs dari atom mirip hidrogen Karakteristik dan sinar-X yang kontinu, panjang gelombang Moseleys de Broglie dari gelombang materi. Silabus JEE untuk Tes Aptitude di B. Arch. Amp B. Des. Gambar tangan Ini terdiri dari gambar sederhana yang menggambarkan total objek dalam bentuk dan proporsinya yang tepat, tekstur permukaan, lokasi relatif dan rincian komponennya dalam skala yang sesuai. Benda sehari-hari yang umum digunakan sehari-hari atau sehari-hari seperti furnitur, peralatan, dan lain-lain dari memori. Gambar geometris Latihan dalam gambar geometris yang berisi garis, sudut, segitiga, segiempat, poligon, lingkaran dll. Studi tentang rencana (tampilan atas), elevasi (tampilan depan atau samping) dari benda padat sederhana seperti prisma, kerucut, silinder, batu, lapisan permukaan yang terentang dll. Persepsi tiga dimensi Pemahaman dan apresiasi bentuk tiga dimensi dengan elemen bangunan, warna, volume dan orientasi. Visualisasi melalui penataan benda di memori. Imajinasi dan sensitivitas estetika. Latihan komposisi dengan elemen yang diberikan. Pemetaan konteks Kreativitas memeriksa melalui uji jarang yang tidak biasa dengan benda yang sudah dikenal. Rasa pengelompokan warna atau aplikasi. Kesadaran arsitektur Kepentingan umum dan kesadaran akan kreasi arsitektural yang terkenal - baik nasional maupun internasional, tempat dan kepribadian (arsitek, perancang, dan lain-lain) di ranah terkait.Bab 14 Sekarang Anda Tahu Bab ini tidak memiliki tujuan dengan cara yang sama seperti yang dilakukan bab sebelumnya. Ini hanya kumpulan topik yang menggambarkan gagasan yang mungkin berguna untuk aplikasi Anda. Beberapa topik, seperti penanganan kesalahan, tidak masuk ke kategori lain, namun terlalu singkat untuk keseluruhan bab. OpenGL adalah semacam sekantong alat tingkat rendah yang sekarang Anda tahu tentang alat tersebut, Anda dapat menggunakannya untuk menerapkan fungsi tingkat lebih tinggi. Bab ini menyajikan beberapa contoh kemampuan tingkat tinggi tersebut. Bab ini membahas berbagai teknik berdasarkan perintah OpenGL yang menggambarkan beberapa kegunaan yang tidak terlalu jelas dimana Anda dapat memasukkan perintah ini. Contohnya tidak dalam urutan tertentu dan tidak berhubungan satu sama lain. Idenya adalah membaca judul bagian dan lompat ke contoh yang menurut Anda menarik. Demi kenyamanan Anda, judulnya tercantum dan dijelaskan sebentar di sini. Catatan: Sebagian besar contoh di bagian lain dari panduan ini sudah lengkap dan dapat dikompilasi dan dijalankan sebagaimana mestinya. Dalam bab ini, bagaimanapun, tidak ada program yang lengkap, dan Anda harus melakukan sedikit pekerjaan sendiri untuk membuatnya berjalan. Penanganan Kesalahan memberitahu Anda bagaimana cara memeriksa kondisi kesalahan OpenGL. Versi mana yang saya gunakan menjelaskan cara mengetahui rincian tentang penerapannya, termasuk nomor versinya. Ini bisa berguna untuk menulis aplikasi yang kompatibel dengan versi OpenGL sebelumnya. Ekstensi ke Standar menyajikan teknik untuk mengidentifikasi dan menggunakan ekstensi khusus vendor ke standar OpenGL. Cheesy Translucency menjelaskan cara menggunakan pengaturan poligon untuk mencapai tembus pandang ini sangat berguna bila Anda tidak memiliki perangkat keras campuran yang tersedia. Efek Fade yang Mudah menunjukkan bagaimana menggunakan pengaturan poligon untuk menciptakan efek memudar ke latar belakang. Pemilihan Objek Menggunakan Back Buffer menggambarkan bagaimana menggunakan buffer belakang dalam sistem double-buffer untuk menangani pemetaan objek sederhana. Transformasi Gambar Murah membahas cara menggambar versi terdistorsi gambar bitmap dengan menggambar setiap piksel sebagai segiempat. Menampilkan Lapisan menjelaskan bagaimana menampilkan beberapa lapisan material yang berbeda dan menunjukkan di mana bahan tumpang tindih. Karakter Antialiased menggambarkan cara menggambar font yang lebih halus. Drawing Round Points menjelaskan cara menggambar poin yang hampir bulat. Interpolasi Gambar menunjukkan bagaimana memadukan perpaduan sempurna dari satu citra ke citra lainnya. Membuat Decals menjelaskan cara menggambar dua gambar, di mana satu adalah semacam decal yang harus selalu tampil di atas yang lain. Menggambar Diisi, Polygon Kapur Menggunakan Stencil Buffer memberi tahu Anda cara menggambar poligon cekung, poligon nonsimple, dan poligon dengan lubang dengan menggunakan penyangga stensil. Menemukan Daerah Gangguan menggambarkan bagaimana menentukan di mana potongan tiga dimensi saling tumpang tindih. Bayangan menggambarkan cara menggambar bayangan objek yang menyala. Hidden-Line Removal membahas cara menggambar objek wireframe dengan garis tersembunyi yang dilepas dengan menggunakan penyangga stensil. Texture-Mapping Applications menggambarkan beberapa penggunaan cerdas untuk pemetaan tekstur, seperti gambar yang berputar dan melengkung. Menggambar Gambar Kedalaman-Buffer memberi Anda cara menggabungkan gambar dalam lingkungan buffer-kedalaman. Domain Dirichlet menjelaskan bagaimana menemukan domain Dirichlet dari satu set titik dengan menggunakan buffer kedalaman. Kehidupan di Stencil Buffer menjelaskan bagaimana menerapkan Game of Life menggunakan stensil buffer. Penggunaan Alternatif untuk glDrawPixels () dan glCopyPixels () menjelaskan bagaimana menggunakan kedua perintah ini untuk efek seperti video palsu, airbrushing, dan gambar yang dialihkan. Penanganan Kesalahan Sebenarnya, program Anda akan membuat kesalahan. Penggunaan rutin penanganan kesalahan sangat penting selama pengembangan dan sangat dianjurkan untuk aplikasi yang diluncurkan secara komersial. (Kecuali Anda dapat memberikan jaminan 100, program Anda tidak akan menghasilkan kondisi kesalahan OpenGL. Dapatkan yang sebenarnya) OpenGL memiliki rutinitas penanganan kesalahan sederhana untuk pustaka GL dan GLU dasar. Ketika OpenGL mendeteksi kesalahan (baik di basis GL atau GLU), ia mencatat kode kesalahan saat ini. Perintah yang menyebabkan kesalahan diabaikan, sehingga tidak berpengaruh pada status OpenGL atau pada isi framebuffer. (Jika kesalahan yang terekam adalah GLOUTOFMEMORY, bagaimanapun, hasil perintahnya tidak terdefinisi.) Setelah dicatat, kode kesalahan saat ini tidak dihapus - yaitu, kesalahan tambahan tidak dicatat - sampai Anda memanggil perintah perintah glGetError (). Yang mengembalikan kode kesalahan saat ini. Setelah Anda bertanya dan membersihkan kode kesalahan saat ini, atau jika tidak ada kesalahan untuk memulai, glGetError () mengembalikan GLNOERROR. GLenum glGetError (void) Mengembalikan nilai dari flag kesalahan. Bila terjadi kesalahan pada GL atau GLU, tanda kesalahan diset ke nilai kode kesalahan yang sesuai. Jika GLNOERROR dikembalikan, tidak ada kesalahan yang terdeteksi sejak panggilan terakhir ke glGetError (). Atau sejak GL diinisialisasi. Tidak ada kesalahan lain yang dicatat sampai glGetError () dipanggil, kode kesalahan dikembalikan, dan flag disetel ulang ke GLNOERROR. Sangat disarankan agar Anda memanggil glGetError () setidaknya satu kali pada tiap display () rutin. Tabel 14-1 mencantumkan kode kesalahan OpenGL yang didefinisikan dasar. Tabel 14-1: Kode Kesalahan OpenGL Memori yang tidak cukup tersisa untuk dieksekusi Perintah Ada juga tiga puluh tujuh kesalahan GLU NURBS (dengan nama konstan non-deskriptif, GLUNURBSERROR1, GLUNURBSERROR2, dan seterusnya), empat belas kesalahan tessellator (GLUTESSMISSINGBEGINPOLYGON, GLUTESSMISSINGENDGOLTO, GLUTESSMISSINGBEGINCONTOUR , GLUTESSMISSINGENDCONTOUR, GLUTESSCOORDTOOLARGE, GLUTESSNEEDCOMBINECALLBACK, dan delapan GLUTESSERROR yang diberi nama generik), dan GLUINCOMPATIBLEGLVERSION. Selain itu, GLU mendefinisikan kode kesalahan GLUINVALIDENUM, GLUINVALIDVALUE, dan GLUOUTOFMEMORY, yang memiliki arti yang sama dengan kode OpenGL terkait. Untuk mendapatkan string deskriptif yang dapat dicetak yang sesuai dengan kode kesalahan GL atau GLU, gunakan GLU routine gluErrorString (). Const GLubyte gluErrorString (GLenum errorCode) Mengembalikan pointer ke string deskriptif yang sesuai dengan nomor kesalahan OpenGL atau GLU yang dilewatkan pada errorCode. Pada Contoh 14-1, rutin penanganan kesalahan sederhana ditunjukkan. Contoh 14-1: Mengetik dan Mencetak Catatan Kesalahan: String yang dikembalikan oleh gluErrorString () tidak boleh diubah atau dibebaskan oleh aplikasi. Versi mana yang saya gunakan Portabilitas aplikasi OpenGL adalah salah satu fitur menarik OpenGL. Namun, versi baru OpenGL mengenalkan fitur baru, yang dapat mengenalkan masalah kompatibilitas ke belakang. Selain itu, Anda mungkin ingin aplikasi Anda tampil sama baiknya pada berbagai implementasi. Misalnya, Anda bisa membuat tekstur memetakan mode rendering default pada satu mesin, namun hanya memiliki bayangan rata di sisi yang lain. Anda dapat menggunakan glGetString () untuk mendapatkan informasi rilis tentang implementasi OpenGL Anda. Const GLubyte glGetString (nama GLenum) Mengembalikan pointer ke string yang menggambarkan aspek implementasi OpenGL. Nama dapat menjadi salah satu dari berikut ini: GLVENDOR, GLRENDERER, GLVERSION, atau GLEXTENSIONS. GLVENDOR mengembalikan nama perusahaan yang bertanggung jawab atas pelaksanaan OpenGL. GLRENDERER mengembalikan pengenal perender, yang biasanya merupakan platform perangkat keras. Untuk informasi lebih lanjut tentang GLEXTENSIONS, lihat bagian selanjutnya, Extensions to the Standard. GLVERSION mengembalikan sebuah string yang mengidentifikasi nomor versi dari implementasi OpenGL ini. String versi ditata sebagai berikut: ltversion numbergtltspacegtltvendor-specific informationgt Nomor versi adalah salah satu dari bentuk dimana semua nomor memiliki satu digit atau lebih. Informasi khusus vendor bersifat opsional. Misalnya, jika implementasi OpenGL ini berasal dari Corporation XYZ fiktif, string yang dikembalikan mungkin yang berarti bahwa implementasi ini merupakan rilis keempat XYZ dari perpustakaan OpenGL yang sesuai dengan spesifikasi untuk OpenGL Version 1.1. Mungkin juga berarti ini adalah rilis 3.2 dari sistem operasi proprietary XYZ. Cara lain untuk query nomor versi untuk OpenGL adalah mencari konstanta simbolis (gunakan pernyataan preprocessor ifdef) bernama GLVERSION11. Tidak adanya GLVERSION11 yang konstan berarti Anda memiliki OpenGL Version 1.0. Catatan: Jika berjalan dari client ke server, seperti saat melakukan rendering tidak langsung dengan ekstensi OpenGL ke X Window System, client dan server mungkin berbeda versi. Jika versi klien Anda ada di depan server Anda, klien Anda mungkin meminta operasi yang tidak didukung di server Anda. Utility Library Version gluGetString () adalah fungsi query untuk Utility Library (GLU) dan mirip dengan glGetString (). Const GLubyte gluGetString (nama GLenum) Mengembalikan pointer ke string yang menggambarkan aspek implementasi OpenGL. Nama bisa menjadi salah satu dari berikut ini: GLUVERSION, atau GLUEXTENSIONS. Perhatikan bahwa gluGetString () tidak tersedia di GLU 1.0. Cara lain untuk menanyakan nomor versi GLU adalah mencari GLUVERSION11 yang simbolis. Tidak adanya GLUVERSION11 konstan berarti Anda memiliki GLU 1.0. Ekstensi pada Standard OpenGL memiliki spesifikasi tertulis formal yang menggambarkan operasi apa yang terdiri dari perpustakaan. Vendor individu atau sekelompok vendor mungkin memutuskan untuk menyertakan fungsi tambahan pada penerapan yang mereka rilis. Nama konstan dan simbolik konstan menunjukkan dengan jelas apakah fitur tersebut merupakan bagian dari standar OpenGL atau ekstensi khusus vendor. Untuk membuat nama khusus vendor, vendor menambahkan pengenal perusahaan (dalam huruf besar) dan, bila diperlukan, informasi tambahan, seperti nama mesin. Misalnya, jika XYZ Corporation ingin menambahkan rutinitas baru dan konstanta simbolis, mereka mungkin berbentuk glCommandXYZ () dan GLDEFINITIONXYZ. Jika XYZ Corporation ingin memiliki ekstensi yang tersedia hanya di papan grafis FooBar-nya, maka namanya mungkin glCommandXYZfb () dan GLDEFINITIONXYZFB. Jika dua vendor lebih setuju untuk menerapkan ekstensi yang sama, maka prosedur dan konstanta sufiks dengan EXT yang lebih umum (glCommandEXT () dan GLDEFINITIONEXT). Jika Anda ingin tahu apakah ekstensi tertentu didukung pada penerapan Anda, gunakan glGetString (GLEXTENSIONS). Ini mengembalikan daftar semua ekstensi dalam pelaksanaannya, dipisahkan oleh spasi. Jika Anda ingin mengetahui apakah ekstensi tertentu didukung, gunakan kode di Contoh 14-2 untuk mencari melalui daftar dan mencocokkan nama ekstensi. Kembali GLTRUE, jika GLFALSE, jika itu isnt. Contoh 14-2: Mengetahui Jika Perluasan Ekstensi Mentransfer Cheesy Anda dapat menggunakan penjajaran poligon untuk mensimulasikan bahan tembus pandang. Ini adalah solusi yang sangat bagus untuk sistem yang tidak memiliki perangkat keras campuran. Karena pola potongan poligon adalah 32x32 bit atau 1024 bit, Anda bisa beralih dari buram menjadi transparan pada 1023 langkah. (Dalam prakteknya, ada banyak langkah lebih banyak dari yang Anda butuhkan) Misalnya, jika Anda menginginkan permukaan yang memungkinkan melalui 29 persen cahaya, cukup buat pola potongan dimana 29 persen (kira-kira 297) piksel di topeng nol Dan sisanya adalah satu. Bahkan jika permukaan Anda memiliki tembus pandang yang sama, jangan gunakan pola potongan yang sama untuk masing-masing, karena keduanya menutupi bit yang sama persis di layar. Make up a different pattern for each by randomly selecting the appropriate number of pixels to be zero. (See Displaying Points, Lines, and Polygons in Chapter 2 for more information about polygon stippling.) If you dont like the effect with random pixels turned on, you can use regular patterns, but they dont work as well when transparent surfaces are stacked. This is often not a problem because most scenes have relatively few translucent regions that overlap. In a picture of an automobile with translucent windows, your line of sight can go through at most two windows, and usually its only one. An Easy Fade Effect Suppose you have an image that you want to fade gradually to some background color. Define a series of polygon stipple patterns, each of which has more bits turned on so that they represent denser and denser patterns. Then use these patterns repeatedly with a polygon large enough to cover the region over which you want to fade. For example, suppose you want to fade to black in 16 steps. First define 16 different pattern arrays: Then load them in such a way that each has one-sixteenth of the pixels in a 32 180 32 stipple pattern turned on and that the bitwise OR of all the stipple patterns is all ones. After that, the following code does the trick: In some OpenGL implementations, you might get better performance by first compiling the stipple patterns into display lists. During your initialization, do something like this: Then, replace this line in the first code fragment By compiling the command to set the stipple into a display list, OpenGL might be able to rearrange the data in the stips array into the hardware-specific form required for maximum stipple-setting speed. Another application for this technique is if youre drawing a changing picture and want to leave some blur behind that gradually fades out to give some indication of past motion. For example, suppose youre simulating a planetary system and you want to leave trails on the planets to show a recent portion of their path. Again, assuming you want to fade in sixteen steps, set up the stipple patterns as before (using the display-list version, say), and have the main simulation loop look something like this: Each time through the loop, you clear one-sixteenth of the pixels. Any pixel that hasnt had a planet on it for sixteen frames is certain to be cleared to black. Of course, if your system supports blending in hardware, its easier to blend in a certain amount of background color with each frame. (See Displaying Points, Lines, and Polygons in Chapter 2 for polygon stippling details, Chapter 7 for more information about display lists, and Blending in Chapter 6 for information about blending.) Object Selection Using the Back Buffer Although the OpenGL selection mechanism (see Selection in Chapter 13 ) is powerful and flexible, it can be cumbersome to use. Often, the situation is simple: Your application draws a scene composed of a substantial number of objects the user points to an object with the mouse, and the application needs to find the item under the tip of the cursor. One way to do this requires your application to be running in double-buffer mode. When the user picks an object, the application redraws the entire scene in the back buffer, but instead of using the normal colors for objects, it encodes some kind of object identifier for each objects color. The application then simply reads back the pixel under the cursor, and the value of that pixel encodes the number of the picked object. If many picks are expected for a single, static picture, you can read the entire color buffer once and look in your copy for each attempted pick, rather than read back each pixel individually. Note that this scheme has an advantage over standard selection in that it picks the object thats in front if multiple objects appear at the same pixel, one behind the other. Since the image with false colors is drawn in the back buffer, the user never sees it you can redraw the back buffer (or copy it from the front buffer) before swapping the buffers. In color-index mode, the encoding is simple - send the object identifier as the index. In RGBA mode, encode the bits of the identifier into the R, G, and B components. Be aware that you can run out of identifiers if there are too many objects in the scene. For example, suppose youre running in color-index mode on a system that has 4-bit buffers for color-index information (16 possible different indices) in each of the color buffers, but the scene has thousands of pickable items. To address this issue, the picking can be done in a few passes. To think about this in concrete terms, assume there are fewer than 4096 items, so all the object identifiers can be encoded in 12 bits. In the first pass, draw the scene using indices composed of the 4 high-order bits, then use the second and third passes to draw the middle 4 bits and the 4 low-order bits. After each pass, read the pixel under the cursor, extract the bits, and pack them together at the end to get the object identifier. With this method, the picking takes three times as long, but thats often acceptable. Note that after you have the high-order 4 bits, you eliminate 1516 of all objects, so you really need to draw only 116 of them for the second pass. Similarly, after the second pass, 255 of the 256 possible items have been eliminated. The first pass thus takes about as long as drawing a single frame does, but the second and third passes can be up to 16 and 256 times as fast. If youre trying to write portable code that works on different systems, break up your object identifiers into chunks that fit on the lowest common denominator of those systems. Also, keep in mind that your system might perform automatic dithering in RGB mode. If this is the case, turn off dithering. Cheap Image Transformation If you want to draw a distorted version of a bitmapped image (perhaps simply stretched or rotated, or perhaps drastically modified by some mathematical function), there are many possibilities. You can use the image as a texture map, which allows you to scale, rotate, or otherwise distort the image. If you just want to scale the image, you can use glPixelZoom() . In many cases, you can achieve good results by drawing the image of each pixel as a quadrilateral. Although this scheme doesnt produce images that are as nice as those you would get by applying a sophisticated filtering algorithm (and it might not be sufficient for sophisticated users), its a lot quicker. To make the problem more concrete, assume that the original image is m pixels by n pixels, with coordinates chosen from 0, m -1 180 0, n -1. Let the distortion functions be x(m,n) and y(m,n). For example, if the distortion is simply a zooming by a factor of 3.2, then x(m,n) 3.2 m and y(m,n) 3.2 n. The following code draws the distorted image: This code draws each transformed pixel in a solid color equal to that pixels color and scales the image size by 3.2. The routine setcolor() stands for whatever the appropriate OpenGL command is to set the color of the image pixel. The following is a slightly more complex version that distorts the image using the functions x ( i,j ) and y ( i,j ): An even better distorted image can be drawn with the following code: This code smoothly interpolates color across each quadrilateral. Note that this version produces one fewer quadrilateral in each dimension than do the flat-shaded versions, because the color image is being used to specify colors at the quadrilateral vertices. In addition, you can antialias the polygons with the appropriate blending function (GLSRCALPHA, GLONE) to get an even nicer image. Displaying Layers In some applications such as semiconductor layout programs, you want to display multiple different layers of materials and indicate where the materials overlap each other. As a simple example, suppose you have three different substances that can be layered. At any point, eight possible combinations of layers can occur, as shown in Table 14-2. Table 14-2 : Eight Combinations of Layers You want your program to display eight different colors, depending on the layers present. One arbitrary possibility is shown in the last column of the table. To use this method, use color-index mode and load your color map so that entry 0 is black, entry 1 is red, entry 2 is green, and so on. Note that if the numbers from 0 through 7 are written in binary, the 4 bit is turned on whenever layer 3 appears, the 2 bit whenever layer 2 appears, and the 1 bit whenever layer 1 appears. To clear the window, set the writemask to 7 (all three layers) and set the clearing color to 0. To draw your image, set the color to 7, and then when you want to draw something in layer n. set the writemask to n. In other types of applications, it might be necessary to selectively erase in a layer, in which case you would use the writemasks just discussed, but set the color to 0 instead of 7. (See Masking Buffers in Chapter 10 for more information about writemasks.) Antialiased Characters Using the standard technique for drawing characters with glBitmap() . drawing each pixel of a character is an all-or-nothing affair - the pixel is either turned on or not. If youre drawing black characters on a white background, for example, the resulting pixels are either black or white, never a shade of gray. Much smoother, higher-quality images can be achieved if intermediate colors are used when rendering characters (grays, in this example). Assuming that youre drawing black characters on a white background, imagine a highly magnified picture of the pixels on the screen, with a high-resolution character outline superimposed on it, as shown in the left side of Figure 14-1. Figure 14-1 : Antialiased Characters Notice that some of the pixels are completely enclosed by the characters outline and should be painted black some pixels are completely outside the outline and should be painted white but many pixels should ideally be painted some shade of gray, where the darkness of the gray corresponds to the amount of black in the pixel. If this technique is used, the resulting image on the screen looks better. If speed and memory usage are of no concern, each character can be drawn as a small image instead of as a bitmap. If youre using RGBA mode, however, this method might require up to 32 bits per pixel of the character to be stored and drawn, instead of the 1 bit per pixel in a standard character. Alternatively, you could use one 8-bit index per pixel and convert these indices to RGBA by table lookup during transfer. In many cases, a compromise is possible that allows you to draw the character with a few gray levels between black and white (say, two or three), and the resulting font description requires only 2 or 3 bits per pixel of storage. The numbers in the right side of Figure 14-1 indicate the approximate percentage coverage of each pixel: 0 means approximately empty, 1 means approximately one-third coverage, 2 means two-thirds, and 3 means completely covered. If pixels labeled 0 are painted white, pixels labeled 3 are painted black, and pixels labeled 1 and 2 are painted one-third and two-thirds black, respectively, the resulting character looks quite good. Only 2 bits are required to store the numbers 0, 1, 2, and 3, so for 2 bits per pixel, four levels of gray can be saved. There are basically two methods to implement antialiased characters, depending on whether youre in RGBA or color-index mode. In RGBA mode, define three different character bitmaps, corresponding to where 1, 2, and 3 appear in Figure 14-1. Set the color to white, and clear for the background. Set the color to one-third gray (RGB (0.666, 0.666, 0.666)), and draw all the pixels with a 1 in them. Then set RGB (0.333, 0.333, 0.333), draw with the 2 bitmap, and use RGB (0.0, 0.0, 0.0) for the 3 bitmap. What youre doing is defining three different fonts and redrawing the string three times, where each pass fills in the bits of the appropriate color densities. In color-index mode, you can do exactly the same thing, but if youre willing to set up the color map correctly and use writemasks, you can get away with only two bitmaps per character and two passes per string. In the preceding example, set up one bitmap that has a 1 wherever 1 or 3 appears in the character. Set up a second bitmap that has a 1 wherever a 2 or a 3 appears. Load the color map so that 0 gives white, 1 gives light gray, 2 gives dark gray, and 3 gives black. Set the color to 3 (11 in binary) and the writemask to 1, and draw the first bitmap. Then change the writemask to 2, and draw the second. Where 0 appears in Figure 14-1, nothing is drawn in the framebuffer. Where 1, 2, and 3 appear, 1, 2, and 3 appear in the framebuffer. For this example with only four gray levels, the savings is small - two passes instead of three. If eight gray levels were used instead, the RGBA method would require seven passes, and the color-map masking technique would require only three. With sixteen gray levels, the comparison is fifteen passes to four passes. (See Masking Buffers in Chapter 10 for more information about writemasks and Bitmaps and Fonts in Chapter 8 for more information about drawing bitmaps.) Can you see how to do RGBA rendering using no more images than the optimized color-index case Hint: How are RGB fragments normally merged into the color buffer when antialiasing is desired Drawing Round Points Draw near-round, aliased points by enabling point antialiasing, turning blending off, and using an alpha function that passes only fragments with alpha greater than 0.5. (See Antialiasing and Blending in Chapter 6 for more information about these topics.) Interpolating Images Suppose you have a pair of images (where image can mean a bitmap image, or a picture generated using geometry in the usual way), and you want to smoothly blend from one to the other. This can be done easily using the alpha component and appropriate blending operations. Lets say you want to accomplish the blending in ten steps, where image A is shown in frame 0 and image B is shown in frame 9. The obvious approach is to draw image A with alpha equal to (9- ampigr )9 and image B with an alpha of i 9 in frame i. The problem with this method is that both images must be drawn in each frame. A faster approach is to draw image A in frame 0. To get frame 1, blend in 19 of image B and 89 of whats there. For frame 2, blend in 18 of image B with 78 of whats there. For frame 3, blend in 17 of image B with 67 of whats there, and so on. For the last step, youre just drawing 11 of image B blended with 01 of whats left, yielding image B exactly. To see that this works, if for frame i you have and you blend in B(9- ampigr ) with (8- ampigr )(9- ampigr ) of whats there, you get Making Decals Suppose youre drawing a complex three-dimensional picture using depth-buffering to eliminate the hidden surfaces. Suppose further that one part of your picture is composed of coplanar figures A and B, where B is a sort of decal that should always appear on top of figure A. Your first approach might be to draw B after youve drawn A, setting the depth-buffering function to replace on greater or equal. Due to the finite precision of the floating-point representations of the vertices, however, round-off error can cause polygon B to be sometimes a bit in front and sometimes a bit behind figure A. Heres one solution to this problem. Disable the depth buffer for writing, and render A. Enable the depth buffer for writing, and render B. Disable the color buffer for writing, and render A again. Enable the color buffer for writing. Note that during the entire process, the depth-buffer test is enabled. In step 1, A is rendered wherever it should be, but none of the depth-buffer values are changed thus, in step 2, wherever B appears over A, B is guaranteed to be drawn. Step 3 simply makes sure that all of the depth values under A are updated correctly, but since RGBA writes are disabled, the color pixels are unaffected. Finally, step 4 returns the system to the default state (writing is enabled both in the depth buffer and in the color buffer). If a stencil buffer is available, the following simpler technique works. Configure the stencil buffer to write one if the depth test passes, and zero otherwise. Render A. Configure the stencil buffer to make no stencil value change, but to render only where stencil values are one. Disable the depth-buffer test and its update. Render B. With this method, its not necessary to initialize the contents of the stencil buffer at any time, because the stencil value of all pixels of interest (that is, those rendered by A) are set when A is rendered. Be sure to reenable the depth test and disable the stencil test before additional polygons are drawn. (See Selecting Color Buffers for Writing and Reading, Depth Test, and Stencil Test in Chapter 10 .) Drawing Filled, Concave Polygons Using the Stencil Buffer Consider the concave polygon 1234567 shown in Figure 14-2. Imagine that its drawn as a series of triangles: 123, 134, 145, 156, 167, all of which are shown in the figure. The heavier line represents the original polygon boundary. Drawing all these triangles divides the buffer into nine regions A, B, C. I, where region I is outside all the triangles. Figure 14-2 : Concave Polygon In the text of the figure, each of the region names is followed by a list of the triangles that cover it. Regions A, D, and F make up the original polygon note that these three regions are covered by an odd number of triangles. Every other region is covered by an even number of triangles (possibly zero). Thus, to render the inside of the concave polygon, you just need to render regions that are enclosed by an odd number of triangles. This can be done using the stencil buffer, with a two-pass algorithm. First, clear the stencil buffer and disable writing into the color buffer. Next, draw each of the triangles in turn, using the GLINVERT function in the stencil buffer. (For best performance, use triangle fans.) This flips the value between zero and a nonzero value every time a triangle is drawn that covers a pixel. After all the triangles are drawn, if a pixel is covered an even number of times, the value in the stencil buffers is zero otherwise, its nonzero. Finally, draw a large polygon over the whole region (or redraw the triangles), but allow drawing only where the stencil buffer is nonzero. Note: Theres a slight generalization of the preceding technique, where you dont need to start with a polygon vertex. In the 1234567 example, let P be any point on or off the polygon. Draw the triangles: P12, P23, P34, P45, P56, P67, and P71. Regions covered by an odd number of triangles are inside other regions are outside. This is a generalization in that if P happens to be one of the polygons edges, one of the triangles is empty. This technique can be used to fill both nonsimple polygons (polygons whose edges cross each other) and polygons with holes. The following example illustrates how to handle a complicated polygon with two regions, one four-sided and one five-sided. Assume further that theres a triangular and a four-sided hole (it doesnt matter in which regions the holes lie). Let the two regions be abcd and efghi, and the holes jkl and mnop. Let z be any point on the plane. Draw the following triangles: zab zbc zcd zda zef zfg zgh zhi zie zjk zkl zlj zmn zno zop zpm Mark regions covered by an odd number of triangles as in . and those covered by an even number as out . (See Stencil Test in Chapter 10 for more information about the stencil buffer.) Finding Interference Regions If youre designing a mechanical part made from smaller three-dimensional pieces, you often want to display regions where the pieces overlap. In many cases, such regions indicate design errors where parts of a machine interfere with each other. In the case of moving parts, it can be even more valuable, since a search for interfering regions can be done through a complete mechanical cycle of the design. The method for doing this is complicated, and the description here might be too brief. Complete details can be found in the paper Interactive Inspection of Solids: Cross-sections and Interferences . by Jarek Rossignac, Abe Megahed, and Bengt-Olaf Schneider (SIGGRAPH 1992 Proceedings). The method is related to the capping algorithm described in Stencil Test in Chapter 10. The idea is to pass an arbitrary clipping plane through the objects that you want to test for interference, and then determine when a portion of the clipping plane is inside more than one object at a time. For a static image, the clipping plane can be moved manually to highlight interfering regions for a dynamic image, it might be easier to use a grid of clipping planes to search for all possible interferences. Draw each of the objects you want to check and clip them against the clipping plane. Note which pixels are inside the object at that clipping plane using an odd-even count in the stencil buffer, as explained in the preceding section. (For properly formed objects, a point is inside the object if a ray drawn from that point to the eye intersects an odd number of surfaces of the object.) To find interferences, you need to find pixels in the framebuffer where the clipping plane is in the interior of two or more regions at once in other words, in the intersection of the interiors of any pair of objects. If multiple objects need to be tested for mutual intersection, store 1 bit every time some intersection appears, and another bit wherever the clipping buffer is inside any of the objects (the union of the objects interiors). For each new object, determine its interior, find the intersection of that interior with the union of the interiors of the objects so far tested, and keep track of the intersection points. Then add the interior points of the new object to the union of the other objects interiors. You can perform the operations described in the preceding paragraph by using different bits in the stencil buffer together with various masking operations. Three bits of stencil buffer are required per pixel - one for the toggling to determine the interior of each object, one for the union of all interiors discovered so far, and one for the regions where interference has occurred so far. To make this discussion more concrete, assume the 1 bit of the stencil buffer is for toggling interiorexterior, the 2 bit is the running union, and the 4 bit is for interferences so far. For each object that youre going to render, clear the 1 bit (using a stencil mask of one and clearing to zero), then toggle the 1 bit by keeping the stencil mask as one and using the GLINVERT stencil operation. You can find intersections and unions of the bits in the stencil buffers using the stenciling operations. For example, to make bits in buffer 2 be the union of the bits in buffers 1 and 2, mask the stencil to those 2 bits, and draw something over the entire object with the stencil function set to pass if anything nonzero occurs. This happens if the bits in buffer 1, buffer 2, or both are turned on. If the comparison succeeds, write a 1 in buffer 2. Also, make sure that drawing in the color buffer is disabled. An intersection calculation is similar - set the function to pass only if the value in the two buffers is equal to 3 (bits turned on in both buffers 1 and 2). Write the result into the correct buffer. (See Stencil Test in Chapter 10 .) Every possible projection of three-dimensional space to three-dimensional space can be achieved with a suitable 4 180 4 invertible matrix and homogeneous coordinates. If the matrix isnt invertible but has rank 3, it projects three-dimensional space onto a two-dimensional plane. Every such possible projection can be achieved with a suitable rank-3 4 180 4 matrix. To find the shadow of an arbitrary object on an arbitrary plane from an arbitrary light source (possibly at infinity), you need to find a matrix representing that projection, multiply it on the matrix stack, and draw the object in the shadow color. Keep in mind that you need to project onto each plane that youre calling the ground. As a simple illustration, assume the light is at the origin, and the equation of the ground plane is ax by c d 0. Given a vertex S( sx,sy,sz ,1), the line from the light through S includes all points ampagr S, where ampagr is an arbitrary real number. The point where this line intersects the plane occurs when ampagr ( asz bsy csz ) d 0, ampagr - ampdgr ( asx bsy csz ). Plugging this back into the line, we get - ampdgr ( ampsgr ampxgr. ampsgr amppsgr. ampsgr ampzgr )( ampagr ampsgr ampxgr ampbgr ampsgr amppsgr ampkhgr ampsgr ampzgr ) for the point of intersection. The matrix that maps S to this point for every S is This matrix can be used if you first translate the world so that the light is at the origin. If the light is from an infinite source, all you have is a point S and a direction D ( dx,dy,dz ). Points along the line are given by Proceeding as before, the intersection of this line with the plane is given by a(sx ampagr dx)b(sy ampagr dy)c(sz ampagr dz)d 0 Solving for ampagr. plugging that back into the equation for a line, and then determining a projection matrix gives This matrix works given the plane and an arbitrary direction vector. Theres no need to translate anything first. (See Chapter 3 and Appendix F .) Hidden-Line Removal If you want to draw a wireframe object with hidden lines removed, one approach is to draw the outlines using lines and then fill the interiors of the polygons making up the surface with polygons having the background color. With depth-buffering enabled, this interior fill covers any outlines that would be obscured by faces closer to the eye. This method would work, except that theres no guarantee that the interior of the object falls entirely inside the polygons outline in fact, it might overlap it in various places. Theres an easy, two-pass solution using either polygon offset or the stencil buffer. Polygon offset is usually the preferred technique, since polygon offset is almost always faster than stencil buffer. Both methods are described here, so you can see how both approaches to the problem work. Hidden-Line Removal with Polygon Offset To use polygon offset to accomplish hidden-line removal, the object is drawn twice. The highlighted edges are drawn in the foreground color, using filled polygons but with the polygon mode GLLINE to rasterize it as a wireframe. Then the filled polygons are drawn with the default polygon mode, which fills the interior of the wireframe, and with enough polygon offset to nudge the filled polygons a little farther from the eye. With the polygon offset, the interior recedes just enough that the highlighted edges are drawn without unpleasant visual artifacts. You may need to adjust the amount of offset needed (for wider lines, for example). (See Polygon Offset in Chapter 6 for more information.) Hidden-Line Removal with the Stencil Buffer Using the stencil buffer for hidden-line removal is a more complicated procedure. For each polygon, youll need to clear the stencil buffer, and then draw the outline both in the framebuffer and in the stencil buffer. Then when you fill the interior, enable drawing only where the stencil buffer is still clear. To avoid doing an entire stencil-buffer clear for each polygon, an easy way to clear it is simply to draw 0s into the buffer using the same polygon outline. In this way, you need to clear the entire stencil buffer only once. For example, the following code represents the inner loop you might use to perform such hidden-line removal. Each polygon is outlined in the foreground color, filled with the background color, and then outlined again in the foreground color. The stencil buffer is used to keep the fill color of each polygon from overwriting its outline. To optimize performance, the stencil and color parameters are changed only twice per loop by using the same values both times the polygon outline is drawn. Texture-Mapping Applications Texture mapping is quite powerful, and it can be used in some interesting ways. Here are a few advanced applications of texture mapping. Antialiased text - Define a texture map for each character at a relatively high resolution, and then map them onto smaller areas using the filtering provided by texturing. This also makes text appear correctly on surfaces that arent aligned with the screen, but are tilted and have some perspective distortion. Antialiased lines - These can be done like antialiased text: Make the line in the texture several pixels wide, and use the texture filtering to antialias the lines. Image scaling and rotation - If you put an image into a texture map and use that texture to map onto a polygon, rotating and scaling the polygon effectively rotates and scales the image. Image warping - As in the preceding example, store the image as a texture map, but map it to some spline-defined surface (use evaluators). As you warp the surface, the image follows the warping. Projecting images - Put the image in a texture map, and project it as a spotlight, creating a slide projector effect. (See The q Coordinate in Chapter 9 for more information about how to model a spotlight using textures.) (See Chapter 3 for information about rotating and scaling, Chapter 9 for more information about creating textures, and Chapter 12 for details on evaluators.) Drawing Depth-Buffered Images For complex static backgrounds, the rendering time for the geometric description of the background can be greater than the time it takes to draw a pixel image of the rendered background. If theres a fixed background and a relatively simple changing foreground, you may want to draw the background and its associated depth-buffered version as an image rather than render it geometrically. The foreground might also consist of items that are time-consuming to render, but whose framebuffer images and depth buffers are available. You can render these items into a depth-buffered environment using a two-pass algorithm. For example, if youre drawing a model of a molecule made of spheres, you might have an image of a beautifully rendered sphere and its associated depth-buffer values that were calculated using Phong shading or ray-tracing or by using some other scheme that isnt directly available through OpenGL. To draw a complex model, you might be required to draw hundreds of such spheres, which should be depth-buffered together. To add a depth-buffered image to the scene, first draw the images depth-buffer values into the depth buffer using glDrawPixels() . Then enable depth-buffering, set the writemask to zero so that no drawing occurs, and enable stenciling such that the stencil buffers get drawn whenever a write to the depth buffer occurs. Then draw the image into the color buffer, masked by the stencil buffer youve just written so that writing occurs only when theres a 1 in the stencil buffer. During this write, set the stenciling function to zero out the stencil buffer so that its automatically cleared when its time to add the next image to the scene. If the objects are to be moved nearer to or farther from the viewer, you need to use an orthographic projection in these cases, you use GLDEPTHBIAS with glPixelTransfer() to move the depth image. (See Coordinate System Survival Kit in Chapter 2. Depth Test and Stencil Test in Chapter 10. and Chapter 8 for details on glDrawPixels() and glPixelTransfer() .) Dirichlet Domains Given a set S of points on a plane, the Dirichlet domain or Voronoi polygon of one of the points is the set of all points in the plane closer to that point than to any other point in the set S. These points provide the solution to many problems in computational geometry. Figure 14-3 shows outlines of the Dirichlet domains for a set of points. Figure 14-3 : Dirichlet Domains If you draw a depth-buffered cone with its apex at the point in a different color than each of the points in S, the Dirichlet domain for each point is drawn in that color. The easiest way to do this is to precompute a cones depth in an image and use the image as the depth-buffer values as described in the preceding section. You dont need an image to draw in the framebuffer as in the case of shaded spheres, however. While youre drawing into the depth buffer, use the stencil buffer to record the pixels where drawing should occur by first clearing it and then writing nonzero values wherever the depth test succeeds. To draw the Dirichlet region, draw a polygon over the entire window, but enable drawing only where the stencil buffers are nonzero. You can do this perhaps more easily by rendering cones of uniform color with a simple depth buffer, but a good cone might require thousands of polygons. The technique described in this section can render much higher-quality cones much more quickly. (See A Hidden-Surface Removal Survival Kit in Chapter 5 and Depth Test in Chapter 10 .) Life in the Stencil Buffer The Game of Life, invented by John Conway, is played on a rectangular grid where each grid location is alive or dead. To calculate the next generation from the current one, count the number of live neighbors for each grid location (the eight adjacent grid locations are neighbors). A grid location is alive in generation n 1 if it was alive in generation n and has exactly two or three live neighbors, or if it was dead in generation n and has exactly three live neighbors. In all other cases, it is dead in generation n 1. This game generates some incredibly interesting patterns given different initial configurations. (See Martin Gardner, Mathematical Games, Scientific American . vol. 223, no. 4, October 1970, p. 120123.) Figure 14-4 shows six generations from a game. Figure 14-4 : Six Generations from the Game of Life One way to create this game using OpenGL is to use a multipass algorithm. Keep the data in the color buffer, one pixel for each grid point. Assume that black (all zeros) is the background color, and the color of a live pixel is nonzero. Initialize by clearing the depth and stencil buffers to zero, set the depth-buffer writemask to zero, and set the depth comparison function so that it passes on not-equal. To iterate, read the image off the screen, enable drawing into the depth buffer, and set the stencil function so that it increments whenever a depth comparison succeeds but leaves the stencil buffer unchanged otherwise. Disable drawing into the color buffer. Next, draw the image eight times, offset one pixel in each vertical, horizontal, and diagonal direction. When youre done, the stencil buffer contains a count of the number of live neighbors for each pixel. Enable drawing to the color buffer, set the color to the color for live cells, and set the stencil function to draw only if the value in the stencil buffer is 3 (three live neighbors). In addition, if this drawing occurs, decrement the value in the stencil buffer. Then draw a rectangle covering the image this paints each cell that has exactly three live neighbors with the alive color. At this point, the stencil buffers contain 0, 1, 2, 4, 5, 6, 7, 8, and the values under the 2s are correct. The values under 0, 1, 4, 5, 6, 7, and 8 must be cleared to the dead color. Set the stencil function to draw whenever the value is not 2, and to zero the stencil values in all cases. Then draw a large polygon of the dead color across the entire image. Youre done. For a usable demonstration program, you might want to zoom the grid up to a size larger than a single pixel its hard to see detailed patterns with a single pixel per grid point. (See Coordinate System Survival Kit in Chapter 2. and Depth Test and Stencil Test in Chapter 10 .) Alternative Uses for glDrawPixels() and glCopyPixels() You might think of glDrawPixels() as a way to draw a rectangular region of pixels to the screen. Although this is often what its used for, some other interesting uses are outlined here. Video - Even if your machine doesnt have special video hardware, you can display short movie clips by repeatedly drawing frames with glDrawPixels() in the same region of the back buffer and then swapping the buffers. The size of the frames you can display with reasonable performance using this method depends on your hardwares drawing speed, so you might be limited to 100 180 100 pixel movies (or smaller) if you want smooth fake video. Airbrush - In a paint program, your airbrush (or paintbrush) shape can be simulated using alpha values. The color of the paint is represented as the color values. To paint with a circular brush in blue, repeatedly draw a blue square with glDrawPixels() where the alpha values are largest in the center and taper to zero at the edges of a circle centered in the square. Draw using a blending function that uses alpha of the incoming color and (1-alpha) of the color already at the pixel. If the alpha values in the brush are all much less than one, you have to paint over an area repeatedly to get a solid color. If the alpha values are near one, each brush stroke pretty much obliterates the colors underneath. Filtered Zooms - If you zoom a pixel image by a nonintegral amount, OpenGL effectively uses a box filter, which can lead to rather severe aliasing effects. To improve the filtering, jitter the resulting image by amounts less than a pixel and redraw it multiple times, using alpha blending to average the resulting pixels. The result is a filtered zoom. Transposing Images - You can swap same-size images in place with glCopyPixels() using the XOR operation. With this method, you can avoid having to read the images back into processor memory. If A and B represent the two images, the operation looks like this:Moving Landscapes Matharoo Associates The idea for moving landscape germinated from stumbling upon a stone, Bidasar Forest, that possesses an impression, as if, of tropical arid landscape fossilized within itself. Its polished surfaces against the native verdure of the Ahmedabad region made for the perfect setting, blurring the lines between reality and illusion. Save this picture The nations booming economy in the last decade has made individual houses accessible to a larger section of society. Coupled with the demand for an independence that protects individuality, the age old tradition of joint family living has disintegrated into small nuclear families. Despite this change of cultural attitude in the present Indian context, a large number of families, bound by family business and obliged by traditional ingrained values, still choose to live together. Whilst this allows them to benefit from shared responsibility across generations, it often leads to the creation of autonomous suites within a house that isolates families even under the same roof. The challenge therefore lies in simultaneously integrating the requirements of these opposing lifestyles - making it equally imperative to provide opportunities for communal collision, while providing privacy. Situated on the outskirts of Ahmedabad. the house is meant to accommodate one of the citys most prolific real-estate developers and his wife, along with his two sons families and extended visiting members. The client also shares the grounds with his two other brothers houses and their joint families in a large 20000 m2 plot. Save this picture The plan of the house is interpreted as a linear pavilion, ensuring that every space in the house is lined with glass on the facing sides the first enclosure. The rest of the structure is in 200mm thin walls in concrete, eliminating the need for any beams and columns and making for cleanest interior volumes. Additionally, this saves constructed dead space by about 3 and for the 18,000 total covered area, this equals to 540 sq.ft or the size of an average sized room. This pavilion is oriented around the margin of the site as three wings. The flanks holds the houses private spaces with suites for each of the sons families, while the central one hosts the living space for all communal activities. The residual corner voids by the turning of the blocks, are snugly protected by tall circular walls to form smaller sheltered spaces while one cradles the houses utility space, the other acts as a court distant from the joint families gaze. These also carry the staircases and lift, rendering outer spaces clear of all encumbrances for the Bidasar drama to unfold. The composition as a whole footprint defines a large multi family courtyard at the heart of the site. Save this picture The second enclosure is a layer of massive 15 high, 9 wide and 16mm thick Bidaser stone walls along the entire perimeter an impregnable shell. Akin to the amethysts hard exterior cracking open to reveal its crystalline heart, at the push of a button, this imposingly heavy stone wall cracks open, as it becomes an array of panels spinning gently about their centres or sliding away to reveal a transparent cocooned interior. Can be employed at will whenever desired and dissolved when not. Save this picture This layer of stone panels help create a buffer between the inside and the outside, protecting the inner layer shell of concrete and glass from intense sun light and 45o heat, thereby reducing the total heat gain on the air-conditioning. Moreover, this space doubles up as passages, verandahs, entrance vestibule and circulation space, and also as protection from rain, eliminating the need for air-conditioning in 8000sq.ft out of a total of 18000 habitable space. This saving is substituted with enhanced living and direct contact with nature in what we term as value architecture. Save this picture Savings from the air-conditioning and sealing the house, is then channelled into making inhouse custom designed motorized pivots and giant sliding systems. Architecturally and structurally both, this entire layer is kept completely detached from the inside structure, almost as a heat buffer, and is only supported on hidden structures within in the sliding and pivoting systems, making for the awe in having thick concrete slabs floating on moving stones. Save this picture Lights are machined out of alabaster stone providing for the most natural ambience. Most furniture is bought out from various design houses in Italy and a sole bar table is one custom designed by the Architects. It is a 3 dimensional mobius strip in stainless steel, locally fabricated, that can be subject of discussion and intellectual discourse after a couple of drinks. Lights and water under the moving walls light the water to make the heavy stones appear floating on water. Toilets too open on opposite ends and the water closet, the shower and the basin, all three are positioned on 3 side of the duct, the fourth side left for easy service access and ventilation to the duct from outside.To carry on with the material amp weight amazement further the thick concrete basin counter is cantilevered from the floor to ceiling mirror. In line with the same philosophy of the easy maintenance and serviceblity AC units have been kept on the roof with just holes cut in slab for blower. This approach of integrating the services and interiors in construction itself doesnt only make it easy to service it also saved a lot of time off construction. The entire building was ready in 18 months time from start to furnish. Save this picture Resonating with the harshest aspects of nature, in motion, these walls intermingle with the glass inside and the wild landscape outside, the third enclosure, to sometimes allow a glimse of the outdoors, sometimes reflect it and sometimes reflecting themselves. It is in this layering of space and screen, the houses entire envelope becomes an interface to mediate between the artifice of the inside and verdant site outside. Save this picture The houses environs look deep inside their interior, as the house merges into an illusion of landscape constantly moving that we sometimes catch ourselves reflecting amongst, reflecting on the nature both within us and outside of us. The epitome of their experience is to be found at the entrance passage of the house, where all of these reflections find the surface of water to make the landscape a truly moving one. Text: Robert Taylor amp Trisha Patel The best of ArchDaily, directly to your inbox
Programmer-stock-options
Vpin-trading-strategy