Selasa, 12 Juni 2012

UNIT IV - Bab 4 - 3D API


UNIT IV - Bab 4 - 3D API


Para pendiri J2ME merilis Permintaan Spesifikasi Jawa (JSR) 184 pada 19 November 2003. Spesifikasi ini mendefinisikan 'Mobile 3D Graphics API. Tujuan utamanya adalah untuk membawa kekuatan grafis 3D dan animasi untuk J2ME perangkat diaktifkan. Spesifikasi ini mendefinisikan satu paket baru, yaitu javax.microedition.m3g. Paket ini merupakan paket opsional dan kompatibel dengan MIDP 1.0, MIDP 2.0 serta CDC.
Hal yang baik tentang API ini adalah bahwa hal itu telah didefinisikan menjaga mempertimbangkan kendala pengolahan dan memori pada perangkat mobile. Hal lain yang telah diingat saat mengembangkan API ini adalah bahwa ada ketentuan untuk mengimpor animasi 3D yang dibangun menggunakan alat pemodelan 3D langsung dari API ini. Fitur ini membuatnya sangat mudah untuk memasukkan animasi 3D ke dalam MIDlet.
API ini memberikan kita dengan baik struktur adegan-grafik dan antarmuka modus segera. Hal ini juga memberikan kita dengan format file efisien untuk menyimpan konten 3D. Para formar file yang disediakan untuk kita memiliki ekstensi bernama. M3G. Tujuannya adalah agar software 3D modeling dapat menyimpan data dalam format file ini. Data ini kemudian dapat digunakan dalam aplikasi langsung. Paket ini berisi kelas yang berguna untuk mengembangkan aplikasi dengan animasi 3D.
Beberapa penggunaan API ini dapat berupa:
·    Pengembangan game 3D
·    3D realistis peta
·    3D aplikasi multimedia
·    3D screen saver
·    Animasi 3D
·    3D user interface
Bagaimana Anda menggunakannya tergantung pada imajinasi Anda dan kendala anggaran dikenakan pada Anda.
javax.microedition.m3g
masyarakat kelas AnimationController
Apa itu?
Kelas ini memperluas Object3D kelas. Dia mengontrol posisi, kecepatan dan berat dari urutan animasi.
 
  • Pembina
·          publik AnimationController ()
Contructor ini dapat digunakan untuk menciptakan objek AnimationController baru. Nilai default untuk ini objek AnimationController baru adalah:
§   aktif interval: (0, 0) (selalu aktif)
§   pencampuran berat: 1,0
§   referensi titik: (0, 0)
§   kecepatan: 1.0
  • Metode
·          public int getActiveIntervalEnd ()
Metode ini mengembalikan waktu akhir dari interval aktif.
·          public int getActiveIntervalStart ()
Metode ini mengembalikan waktu mulai dari interval aktif.
·          publik mengapung getPosition (int WorldTime)
Metode pengembalian animasi urutan posisi dalam jumlah unit waktu yang telah berlalu sejak mulai dari animasi ini, sampai WorldTime.
·          publik floa t getSpeed ​​()
Metode ini mengembalikan kecepatan pemutaran saat ini objek AnimationController.
·          publik mengapung getWeight ()
Metode ini mengembalikan berat campuran saat ini.
·          public void setActiveInterval (int awal, akhir int)
Metode ini digunakan untuk mengatur interval waktu selama dunia ini pengendali animasi aktif.
·          public void setPosition (sequenceTime float, WorldTime int)
Metode ini digunakan untuk menetapkan posisi pemutaran baru untuk animasi ini relatif terhadap waktu dunia controller.
§   public void setSpeed ​​(kecepatan float, WorldTime int)
Metode ini digunakan untuk mengatur kecepatan pemutaran baru untuk animasi ini.
§   public void setWeight (berat float)
Metode ini digunakan untuk mengatur berat campuran untuk controller ini animasi. Nilai untuk berat pencampuran harus positif atau nol.
masyarakat kelas AnimationTrack
Apa itu?
Kelas ini mengaitkan KeyframeSequence dengan AnimationController dan properti animatable.
Apakah yang dimaksud dengan properti animatable?
Animatable properti adalah skalar atau vektor variabel bahwa sistem animasi bisa langsung update. Orientasi Node adalah contoh yang baik dari properti animatable.

o     Konstruktor
§   publik AnimationTrack (urutan KeyframeSequence, properti int)
Konstruktor ini menciptakan objek AnimationTrack dengan urutan keyframe diberikan menargetkan properti yang diberikan.
o     Bidang
§   ALPHA public int static final
Kolom ini menentukan berikut sebagai target animasi:
·    Alpha faktor Node, atau
·    Komponen alpha dari warna Latar Belakang
·    Berdifusi Bahan warna, atau
·      VertexBuffer standar warna
§   public int akhir statis AMBIENT_COLOR
Kolom ini menentukan warna ambien dari Bahan sebagai sasaran animasi.
§   WARNA public int static final
Kolom ini menentukan berikut sebagai target animasi:
·    Warna Light
·    Latar Belakang, atau
·    Kabut, atau
·    Tekstur paduan warna di Texture2D, atau
·    VertexBuffer standar warna
§   TANAMAN public int static final
Kolom ini menentukan parameter tanam dari Sprite3D atau Latar Belakang sebagai sasaran animasi.
§   KEPADATAN public int static final
Kolom ini menentukan kepadatan dalam kabut Kabut sebagai sasaran animasi.
§   public int akhir statis DIFFUSE_COLOR
Kolom ini menentukan warna menyebar dari Bahan sebagai sasaran animasi.
§   public int akhir statis EMISSIVE_COLOR
Kolom ini menentukan warna memancarkan dari Bahan sebagai sasaran animasi.
§   FAR_DISTANCE public int static final
Kolom ini menentukan jarak jauh dari Kamera atau Kabut sebagai sasaran animasi.
§   FIELD_OF_VIEW public int static final
Kolom ini menentukan bidang pandang kamera sebagai target animasi.
§   INTENSITAS public int static final
Kolom ini menentukan intensitas cahaya sebagai sasaran animasi.
§   public static int MORPH_WEIGHTS akhir
Kolom ini menentukan bobot sasaran morph dari MorphingMesh sebagai sasaran animasi.
§   NEAR_DISTANCE public int static final
Kolom ini menentukan jarak dekat dari Kamera atau Kabut sebagai sasaran animasi.
§   ORIENTASI public int static final
Kolom ini menentukan komponen orientasi transformasi objek Transformable sebagai sasaran animasi.
§   PICKABILITY public int static final
Kolom ini menentukan memilih yang memungkinkan bendera Node sebagai sasaran animasi.
§   SKALA publik statis int akhir
Kolom ini menentukan komponen scaling transformasi objek Transformable sebagai sasaran animasi.
§   shininess public int static final
Field ini menentukan shininess dari Bahan sebagai sasaran animasi.
§   public int akhir statis SPECULAR_COLOR
Kolom ini menentukan warna specular dari Bahan sebagai sasaran animasi.
§   SPOT_ANGLE public int static final
Kolom ini menentukan sudut spot Light sebagai sasaran animasi.
§   SPOT_EXPONENT public int static final
Kolom ini menentukan eksponen spot Light sebagai sasaran animasi.
§   TERJEMAHAN public int static final
Kolom ini menentukan komponen terjemahan dari transformasi objek Transformable sebagai sasaran animasi.
§   Visibilitas public int static final
Kolom ini menentukan rendering memungkinkan bendera Node sebagai sasaran animasi.
  • Metode
§   publik AnimationController getController ()
Metode ini mengambil controller animasi digunakan untuk mengendalikan jalur animasi.
§   publik KeyframeSequence getKeyframeSequence ()
Metode ini mengembalikan objek urutan keyframe yang mendefinisikan nilai-nilai keyframe untuk jalur animasi.
§   publik int getTargetProperty ()
Metode ini mengembalikan properti ditargetkan oleh AnimationTrack ini. Nilai yang dikembalikan adalah salah satu dari konstanta simbolis tercantum di atas.
§   public void setController (AnimationController controller)
Metode ini menentukan controller animasi yang akan digunakan untuk mengendalikan jalur animasi.
masyarakat kelas Penampilan
Apa itu?
§   Kelas ini mendefinisikan satu set objek komponen yang mendefinisikan atribut rendering dari Mesh atau Sprite3D. Atribut Penampilan dikelompokkan ke dalam objek komponen. Setiap komponen objek berisi data untuk satu set properti yang secara fungsional dan logis berhubungan satu sama lain.
Yang kelas kelas Penampilan komponen?

Kelas berikut adalah kelas Penampilan compoenent ini:
·    Bahan
·    PolygonMode
·    CompositingMode
·    Kabut
·    Texture2D
o     Konstruktor
  • Penampilan publik ()
Konstruktor ini membangun sebuah objek Penampilan dengan nilai default. Berikut ini adalah nilai default dari objek yang dibuat:
    • Rendering lapisan: 0
    • Polygon mode: null (default digunakan)
    • Compositing program: null (default digunakan)
    • Semua tekstur: null (semua unit texturing dinonaktifkan)
    • Bahan: null (pencahayaan dinonaktifkan)
    • Kabut: null (cacat fogging)
o     Metode
§   publik CompositingMode getCompositingMode ()
Metode ini mengembalikan CompositingMode saat Penampilan ini.
§   Kabut publik getFog ()
Metode ini mengembalikan atribut fogging saat Penampilan ini.
§   public int getLayer ()
Metode ini memberi kita lapisan render saat Penampilan ini.
§   umum Bahan getMaterial ()
Metode ini mengembalikan Bahan Penampilan saat ini.
§   publik PolygonMode getPolygonMode ()
Metode ini mengembalikan PolygonMode saat Penampilan ini.
§   publik Texture2D getTexture (int indeks)
Metode ini mengambil gambar tekstur saat ini dan atributnya untuk unit tekstur yang diberikan.
§   public void setCompositingMode (CompositingMode compositingMode)
Metode ini menetapkan CompositingMode digunakan untuk Penampilan ini.
§   public void setFog (kabut Kabut)
Metode ini menentukan atribut yang akan digunakan untuk fogging Penampilan ini.
§   public void setLayer (int layer)
Metode ini menetapkan lapisan render Penampilan ini.
§   public void setMaterial (bahan Material)
Metode ini menetapkan Bahan untuk digunakan saat menyalakan Penampilan ini.
§   public void setPolygonMode (PolygonMode polygonMode)
Metode ini menetapkan PolygonMode digunakan untuk Penampilan ini.
§   public void setTexture (int indeks, tekstur Texture2D)
Metode ini menetapkan gambar tekstur dan atributnya untuk unit tekstur yang diberikan.
public class Latar Belakang
Apa itu?
Kelas Latar Belakang mendefinisikan apakah viewport harus dibersihkan dan bagaimana seharusnya itu dibersihkan. Tujuan Latar Belakang digunakan untuk membersihkan bagian-bagian dari frame buffer yang sesuai dengan viewport saat ini.
o     Konstruktor
  • publik Background ()
Konstruktor ini membangun sebuah Latar Belakang baru dengan nilai default. Nilai default untuk objek Latar Belakang yang dibuat adalah:
§   Warna jelas aktifkan: benar (jelas buffer warna)
§   Kedalaman jelas aktifkan: benar (jelas buffer kedalaman)
§   Warna latar belakang: 0x00000000 (hitam, transparan)
§   Latar Belakang gambar: null (menggunakan warna latar belakang saja)
§   Gambar latar belakang modus: BORDER, BORDER
§   Tanaman persegi panjang: undefined (reset di setImage)  
o     Bidang
  • PESANAN public int static final
Kolom ini menentukan bahwa piksel imajiner di luar batas-batas sumber gambar dalam arah X atau Y yang dianggap memiliki warna latar belakang.
  • REPEAT public int static final
Kolom ini menentukan bahwa piksel imajiner di luar batas-batas sumber gambar dalam arah X atau Y yang dianggap memiliki warna yang sama dengan pixel dalam posisi yang sesuai pada gambar sumber.
o     Metode
  • public int getColor ()
Metode ini mengambil warna latar belakang saat ini.
  • public int getCropHeight ()
Metode ini mendapatkan ketinggian persegi panjang tanam lancar sesuai dengan gambar sumber.
  • public int getCropWidth ()
Metode ini mengembalikan lebar dari persegi panjang tanam dalam gambar sumber.
  • public int getCropX ()
Metode ini mengembalikan X offset persegi panjang tanam.
  • public int getCropY ()
Metode ini mengembalikan Y offset persegi panjang tanam.
  • publik Image2D getImage ()
Metode ini mengembalikan gambar latar belakang saat ini.
  • public int getImageModeX ()
Metode ini mengembalikan repeat mode X.
  • public int getImageModeY ()
Metode ini mengembalikan repeat mode Y.
  • public boolean isColorClearEnabled ()
Metode ini mengembalikan nilai true jika warna kliring buffer diaktifkan. Lain jika sudah dinonaktifkan maka palsu dikembalikan.
  • public boolean isDepthClearEnabled ()
Metode ini mengembalikan nilai true jika kedalaman kliring buffer diaktifkan. Jika dinonaktifkan maka palsu dikembalikan.
  • public void setColor (int ARGB)
Metode ini menetapkan warna latar belakang.
  • public void setColorClearEnable (boolean enable)
Metode ini mengaktifkan atau menonaktifkan kliring warna penyangga.
  • public void setCrop (int cropX, int cropY, lebar int, tinggi int)
Metode ini menetapkan persegi panjang tanam dalam gambar latar belakang.
  • public void setDepthClearEnable (boolean enable)
Metode ini mengaktifkan atau menonaktifkan kliring penyangga mendalam.
  • public void setImage (gambar Image2D)
Metode ini menetapkan gambar latar belakang atau beralih dari modus foto latar belakang untuk modus latar belakang warna.
  • public void setImageMode (int modeX, int modeY)
Metode ini menetapkan gambar latar belakang modus ulangi untuk X dan arah Y.
public class Kamera
Apa itu?
Kamera adalah grafik adegan node yang mendefinisikan posisi penampil dalam adegan. Hal ini juga mendefinisikan proyeksi dari 3D ke 2D. Dalam sistem koordinat lokal, selalu menghadap ke arah sumbu Z negatif, (0 0 -1).
o     Konstruktor
  • Kamera publik ()
Konstruktor ini menciptakan node Kamera baru dengan nilai default. Nilai default dengan dimana tujuan Kamera dibuat adalah sebagai berikut:
§   Proyeksi program: PARALEL
§   Lihat volume: sudut yang berlawanan di (-1 -1 -1) dan (1 1 1)
o     Bidang
  • public int GENERIC statis
Kolom ini menentukan matriks 4x4 proyeksi generik.
  • public int PARALEL statis
Kolom ini menentukan matriks proyeksi paralel.
  • public int PERSPEKTIF statis
Kolom ini menentukan matriks proyeksi perspektif.
o     Metode
  • public int getProjection (float [] params)
Metode ini mengembalikan jenis proyeksi. Jenis proyeksi mungkin GENERIC, PERSPEKTIF atau PARALEL.
  • public int getProjection (Transform Transform)
Metode ini mengembalikan jenis proyeksi. Jenis proyeksi mungkin GENERIC, PERSPEKTIF atau PARALEL.
  • public void setGeneric (Transform Transform)
Metode ini menetapkan transformasi 4x4 diberikan sebagai matriks proyeksi saat ini.
  • public void setParallel (float fovy, aspectRatio mengambang, mengapung dekat, melayang jauh)
Metode ini membangun sebuah matriks proyeksi paralel dan menetapkan bahwa sebagai matriks proyeksi saat ini.
  • public void setPerspective (float fovy, mengapung   aspectRatio, mengapung dekat, melayang jauh)
Metode ini membangun sebuah matriks proyeksi perspektif dan menetapkan bahwa sebagai matriks proyeksi saat ini.
masyarakat kelas CompositingMode
Apa itu?
CompositingMode merupakan komponen Penampilan yang merangkum per-pixel atribut composite.
o     Konstruktor
  • publik CompositingMode ()
Konstruktor ini membangun sebuah objek CompositingMode dengan nilai default berikut:
§   pencampuran modus        : REPLACE
§   alfa ambang       : 0,0
§   kedalaman diimbangi            : 0,0, 0,0
§   kedalaman pengujian               : Diaktifkan
§   Kedalaman menulis             : Diaktifkan
§   Warna menulis : Diaktifkan
§   Alpha menulis : Eabled
o     Bidang
  • ALPHA public int static final
Bidang ini memilih mode alpha blend.
  • int akhir public static ALPHA_ADD
Bidang ini memilih mode campuran aditif.
  • int akhir public static memodulasi
Bidang ini memilih blending mode dasar modulasi;
  • public int akhir statis MODULATE_X2
Bidang ini memilih mode blending cerah modulasi.
  • REPLACE public int static final
Bidang ini memilih mode ganti.
o     Metode
  • float publik getAlphaThreshold ()
Metode ini mengembalikan ambang alpha saat ini.
  • public int getBlending ()
Metode ini mengembalikan blending mode yang sedang aktif.
  • float publik getDepthOffsetFactor ()
Metode ini mengembalikan faktor kedalaman arus offset.
  • publik mengambang getDepthOffsetUnits ()
Metode ini mengembalikan kedalaman arus offset dalam satuan kedalaman.
  • public boolean isAlphaWriteEnabled ()
Metode ini mengembalikan nilai true jika alpha penulisan diaktifkan. Ini akan mengembalikan false dalam kasus lain.
  • public boolean isColorWriteEnabled ()
Metode ini mengembalikan nilai true jika tulisan warna diaktifkan. Ini akan mengembalikan false dalam kasus lain.
  • public boolean isDepthTestEnabled ()
Metode ini mengembalikan nilai true jika pengujian mendalam diaktifkan. Ini akan mengembalikan false dalam kasus lain.
  • public boolean isDepthWriteEnabled ()
Metode ini mengembalikan nilai true jika tulisan mendalam diaktifkan. Ini akan mengembalikan false dalam kasus lain.
  • public void setAlphaThreshold (ambang float)
Metode ini menentukan nilai ambang untuk pengujian alpha. Dalam hal komponen alpha dari fragmen kurang dari ambang batas alfa, fragmen tidak diberikan.
  • public void setAlphaWriteEnable (boolean enable)
Metode ini mengaktifkan atau menonaktifkan penulisan nilai alpha fragmen ke dalam buffer warna.
  • public void setBlending (int mode)
Metode ini memilih metode menggabungkan pixel yang akan diberikan dengan pixel sudah dalam frame buffer. Langkah terakhir dari pipa pengolahan pixel pencampuran.
  • public void setColorWriteEnable (boolean enable)
Metode ini mengaktifkan atau menonaktifkan penulisan nilai warna fragmen ke dalam buffer warna.
  • public void setDepthOffset (float factor, unit float)
Metode ini mendefinisikan nilai yang ditambahkan ke ruang layar Z koordinat pixel segera sebelum tes mendalam dan menulis mendalam.
  • public void setDepthTestEnable (memungkinkan boolean)
Metode ini mengaktifkan atau menonaktifkan pengujian mendalam.
  • public void setDepthWriteEnable (boolean enable)
Metode ini mengaktifkan atau menonaktifkan penulisan nilai kedalaman fragmen ke dalam buffer kedalaman.
masyarakat kelas Kabut
Apa itu?
Kabut adalah komponen tampilan yang merangkum atribut untuk fogging.
o     Konstruktor
  • Kabut publik ()
Konstruktor ini menciptakan objek Kabut baru dengan nilai default berikut:
§   modus: LINEAR
§   air: 1,0 (kabut eksponensial saja)
§   dekat jarak: 0,0 (kabut linear saja)
§   jauh jarak: 1.0 (kabut linear saja)
§   warna: 0x00000000
o     Bidang
  • public int akhir statis EKSPONENSIAL
Bidang ini singkatan parameter untuk setMode. Ini menentukan kabut eksponensial.
  • public int akhir statis LINEAR
Bidang ini singkatan parameter untuk setMode. Ini menentukan kabut linier.
o     Metode
  • publik int getColor ()
Metode ini mengembalikan warna saat Kabut ini dalam 0x00RRGGBB format.
  • float publik getDensity ()
Metode ini mengembalikan densitas arus Kabut ini.
  • float publik getFarDistance ()
Metode ini mengembalikan jarak saat ini ke pesawat kabut linier jauh.
  • public int getMode ()
Metode ini mengembalikan mode kabut saat ini yang akan salah satu dari konstanta simbolis dibahas sebelumnya.
  • float publik getNearDistance ()
Metode ini mengembalikan jarak saat ini ke kabut linier dekat pesawat.
  • public void setColor (int RGB)
Metode ini menyetel warna Kabut ini.
  • public void setDensity (kepadatan float)
Metode ini menetapkan kepadatan kabut kabut untuk eksponensial.
  • public void setLinear (float dekat, melayang jauh)
Metode ini menetapkan jarak dekat dan jauh untuk kabut linier.
  • public void setMode (int mode)
Metode ini mengatur mode kabut yang baik mungkin linear atau eksponensial.
public class Graphics3D
Apa itu?

Graphics3D adalah 3D tunggal grafis konteks yang dapat terikat untuk target rendering. Render Semua ini dilakukan melalui metode render dalam kelas ini, termasuk render objek Dunia. Tidak ada cara lain untuk menggambar sesuatu di API ini.
Ada empat metode render yang berbeda
·          Metode pertama adalah untuk rendering seluruh World.
·          Metode kedua adalah untuk rendering node adegan grafik.
·          Metode ketiga dan keempat adalah untuk rendering sebuah submesh individu.
Rendering target
Sebelum membuat sesuatu atau bahkan membersihkan layar, aplikasi tersebut harus mengikat target render untuk Graphics3D ini, dengan menggunakan metode bindTarget. Setelah selesai dengan render sebuah frame, aplikasi tersebut harus melepaskan target render dengan memanggil metode releaseTarget.
o     Bidang
·                      public static int antialias akhir
Kolom ini menentukan parameter untuk metode bindTarget. Ini menentukan antialiasing yang harus diaktifkan.
·                      Dither public int static final
Kolom ini menentukan parameter untuk metode bindTarget. Ini menentukan bahwa dithering harus dihidupkan.
·                      public int akhir statis _COLOR BENAR
Kolom ini menentukan parameter untuk metode bindTarget. Ini menentukan bahwa rendering warna sejati harus diaktifkan.
o     Metode
·                      public int addLight (cahaya Cahaya, Transform mentransformasi)
            Metode ini mengikat Cahaya untuk digunakan dalam modus langsung berikutnya            rendering.
·                      public void bindTarget (target Object)
Metode ini mengikat Grafis diberikan atau bisa berubah Image2D sebagai target render Graphics3D ini.
·                      public void bindTarget (Object target, boolean depthBuffer, petunjuk int)
Metode ini mengikat Grafis diberikan atau bisa berubah Image2D sebagai target render Graphics3D ini. Metode ini mirip dengan varian yang dibahas di atas dari bindTarget, tetapi memungkinkan buffering kedalaman memungkinkan Bendera dan petunjuk kualitas rendering yang akan ditentukan.
·                      public void jelas (latar belakang Latar Belakang)
            Metode ini membersihkan viewport sebagaimana ditentukan dalam Latar Belakang diberikan     objek.
·                      public static Graphics3D getInstance ()
            Metode ini mengambil contoh Graphics3D tunggal yang terkait dengan aplikasi ini. Jadi contoh yang sama akan dikembalikan setiap kali metode ini disebut.
·                      publik Hashtable getProperties statis ()
                        Metode ini mengambil sifat pelaksanaannya yang spesifik.
·                      public void releaseTarget ()
                        Flushes Metode ini gambar 3D yang diberikan ke target saat ini terikat dan kemudian melepaskan target. Hal ini memastikan bahwa gambar 3D sebenarnya dibuat terlihat pada target yang ditetapkan dalam metode bindTarget.
·                      public void render (node ​​Node, Transform mentransformasi)
                        Metode ini membuat node Sprite3D, Mesh atau Group diberikan dengan transformasi yang diberikan dari koordinat lokal ke koordinat dunia.

·                      public void render (VertexBuffer simpul, segitiga IndexBuffer, penampilan Penampilan, Transform mentransformasi)
                        Metode ini menerjemahkan submesh diberikan dengan transformasi yang diberikan dari                     koordinat lokal ke koordinat dunia.
·                      public void render (VertexBuffer simpul, IndexBuffer segitiga, penampilan Penampilan, Transform mentransformasi, ruang lingkup int)
                        Metode ini menerjemahkan submesh diberikan dengan lingkup tertentu dan transformasi diberikan dari koordinat lokal ke koordinat dunia.
·                      public void render (Dunia dunia)
                        Metode ini membuat citra dunia seperti yang terlihat oleh kamera aktif Dunia itu.
·                      public void resetLights ()
                        Metode ini membersihkan array lampu saat ini.
·                      public void setCamera (kamera Kamera, Transform mentransformasi)
                        Metode ini menetapkan Kamera untuk digunakan dalam modus render berikutnya segera.
·                      public void setDepthRange (float dekat, melayang jauh)
                        Metode ini menentukan pemetaan nilai-nilai kedalaman dari perangkat normalisasi koordinat ke koordinat jendela.
·                      kekosongan setLight publik (int index, cahaya Cahaya, Transform mentransformasi)
                        Metode ini unbinds atau mengikat Cahaya untuk rendering modus berikutnya segera.
·                      public void setViewport (int x, int y, int width, int tinggi)
                        Metode ini menentukan viewport persegi panjang pada target render saat ini terikat.                             
Apa yang dimaksud dengan viewport?
Viewport adalah daerah di mana tampilan dari kamera saat ini akan muncul.
Kelompok masyarakat kelas
Apa itu?
Kelompok kelas mendefinisikan node adegan grafik yang menyimpan unordered set node sebagai anak-anaknya.
o     Konstruktor
  • Grup publik ()
Konstruktor ini membangun node Grup baru dan menginisialisasi itu dengan daftar kosong anak-anak.
o     Metode
  • public void addChild (anak Node)
Metode ini menambahkan node yang diberikan kepada Grup ini. Ini berpotensi mengubah urutan dan indeks dari anak-anak sebelumnya ditambahkan.
  • publik Node getChild (int indeks)
Metode ini mendapatkan seorang anak dengan indeks.
  • public int getChildCount ()
Metode ini mengembalikan jumlah anak langsung melekat ke grup ini.
  • publik boolean pick (int lingkup, float x, float y, Kamera kamera, ri RayIntersection)
Metode ini mengembalikan nilai true jika sinar berpotongan Mesh atau Sprite3D a. Ini akan mengembalikan false dalam kasus lain.
  • publik boolean   memilih (lingkup int, sapi mengambang, mengambang oy, float oz, float dx, dy mengambang, mengambang dz, ri RayIntersection)
Metode ini mengembalikan nilai true jika sinar berpotongan Mesh. Ini akan mengembalikan false dalam kasus lain.
  • public void removeChild (anak Node)
Metode ini menghilangkan node yang diberikan dari Grup ini. Hal ini berpotensi dapat mengubah urutan dan indeks dari anak-anak yang tersisa.
public class Image2D
Apa itu?

Image2D adalah kelas yang mewakili dua dimensi gambar yang dapat digunakan sebagai gambar tekstur, latar belakang atau sprite.
Apa gambar Diubah dan immutable dalam konteks dengan Image2D?
o     Diubah: Isi dari gambar bisa berubah dapat diperbarui setiap saat dengan render ke dalamnya atau dengan menggunakan metode yang ditetapkan. Perubahan pada gambar ini akan segera tercermin.
o     Abadi: Isi dari gambar berubah adalah tetap pada saat konstruksi dan tidak dapat diubah kemudian.
o     Konstruktor
  • publik Image2D (format int, lebar int, tinggi int)
Konstruktor ini membangun sebuah objek Image2D kosong dengan dimensi tertentu.
  • publik Image2D (format int, lebar int, tinggi int, byte [] image)
Konstruktor ini membangun sebuah objek berubah Image2D dengan menyalin piksel dari array byte.
  • publik Image2D (format int, lebar int, tinggi int, byte [] image, byte [] palet)
Konstruktor ini membangun sebuah objek berubah Image2D dengan menyalin indeks palet dari array byte dan entri palet dari yang lain array byte.
  • publik Image2D (int format, gambar Object)
Konstruktor ini membangun sebuah objek berubah Image2D dengan menyalin piksel dari citra MIDP atau AWT.
o     Bidang
  • ALPHA public int static final
Bidang ini adalah parameter konstruktor yang menetapkan bahwa Image2D ini memiliki komponen alpha saja.
Catatan: Jenis gambar tidak dapat digunakan sebagai target render atau latar belakang.
  • Luminance public int static final
Bidang ini adalah parameter konstruktor yang menetapkan bahwa Image2D ini memiliki komponen luminance saja.
Catatan: Jenis gambar tidak dapat digunakan sebagai target render atau latar belakang.
  • public int statis LUMINANCE_ALPHA akhir
Bidang ini adalah parameter konstruktor yang menetapkan bahwa Image2D ini memiliki pencahayaan dan komponen alpha.
Catatan: Jenis gambar tidak dapat digunakan sebagai target render atau latar belakang.
  • public static final int RGB
Bidang ini adalah parameter konstruktor yang menetapkan bahwa Image2D ini memiliki merah, hijau dan komponen warna biru.
  • static int RGBA
Bidang ini adalah parameter konstruktor yang menetapkan bahwa Image2D ini memiliki merah, hijau, biru dan komponen alpha.
o     Metode
  • public int getFormat ()
Metode ini mengembalikan format internal Image2D ini.
  • public int getHeight ()
Metode ini mengembalikan ketinggian gambar ini.
  • public int getWidth ()
Metode ini mengembalikan lebar gambar ini.
  • public boolean isMutable ()
Metode ini mengembalikan nilai true jika Image2D ini bisa berubah. Ini akan mengembalikan false jika adalah kekal.
  • public void set (int x, int y, int lebar, tinggi byte, int [] gambar)
Metode ini update area persegi dari Image2D ini dengan menyalin piksel dari array byte. Metode ini dapat digunakan hanya untuk bisa berubah gambar.
masyarakat kelas IndexBuffer abstrak
Apa itu?
IndexBuffer meluas kelas Object3D. Kelas IndexBuffer mendefinisikan bagaimana menghubungkan simpul untuk membentuk objek geometris. Setiap objeknya yang mendefinisikan sebuah submesh. Ini adalah kelas abstrak yang menyediakan fungsionalitas tidak. TriangleStripArray saat ini satu-satunya kelas yang berasal dari IndexBuffer. TriangleStripArray mendefinisikan submesh terdiri dari strip segitiga.
masyarakat kelas KeyframeSequence
Apa itu?
Kelas KeyframeSequence merangkum data animasi sebagai urutan waktu dicap keyframes vektor dihargai. Setiap keyframe singkatan nilai dari suatu kuantitas animasi pada suatu saat waktu tertentu. Jumlah komponen vektor per keyframe ditentukan dalam constructor. Jumlah komponen vektor per keyframe adalah sama untuk semua keyframes dalam urutan.
o     Konstruktor
  • publik KeyframeSequence (numKeyframes int, numComponents int, int interpolasi)
Konstruktor ini menciptakan objek KeyframeSequence baru sesuai dengan parameter tertentu.  
o     Bidang
  • public int akhir statis KONSTAN
Bidang ini mengatakan bahwa urutan ini adalah untuk diputar ulang hanya sekali dan tidak diulang.
  • public int akhir statis LINEAR
Bidang ini adalah parameter konstruktor yang menetapkan bahwa harus ada interpolasi linier antara keyframes.
  • LOOP public int static final
Bidang ini adalah suatu parameter untuk setRepeatMode. Ini menentukan bahwa urutan ini harus diulangi tanpa batas.
  • public int statis SLERP akhir
Bidang ini adalah parameter konstruktor yang menentukan interpolasi linier bulat dari quaternions.
  • SPLINE public int static final
Bidang ini adalah parameter konstruktor yang menentukan interpolasi spline antara keyframes.
  • SQUAD public int static final
Bidang ini adalah parameter konstruktor yang menentukan interpolasi spline dari quaternions.
  • LANGKAH public int static final
Bidang ini adalah parameter konstruktor yang menentukan melangkah dari satu nilai ke keyframe berikutnya.
o     Metode
  • public int getDuration ()
Metode ini mengembalikan durasi urutan ini dalam satuan waktu berurutan.
  • public int getRepeatMode ()
Metode ini mengembalikan repeat mode saat ini. Nilai kembali mungkin KONSTAN atau LOOP.
  • public void setDuration (int durasi)
Metode ini menetapkan durasi urutan ini dalam satuan waktu berurutan.
  • void (int index, waktu int, float [] value) publik setKeyframe
Metode ini menetapkan posisi waktu dan nilai dari keyframe tertentu.
  • public void setRepeatMode (int mode)
Metode ini mengatur mode terulangnya KeyframeSequence ini. Ada dua nilai yang dapat diatur: LOOP dan KONSTAN.
  • public void setValidRange (int pertama, terakhir int)
Metode ini memilih berbagai keyframes yang disertakan dalam animasi.
public class Cahaya
Apa itu?

Cahaya kelas adalah grafik adegan node yang mewakili berbagai jenis sumber cahaya. Sumber cahaya digunakan untuk menentukan warna setiap objek sesuai dengan atribut Bahan nya.
o     Konstruktor
  • publik Cahaya ()
Konstruktor ini membangun sebuah cahaya baru dengan nilai default berikut:
• Modus: directional
• Warna: 0x00FFFFFF (1,0, 1,0, 1,0)
• intensitas: 1.0
• redaman: (1, 0, 0)
• titik sudut: 45 derajat
• tempat eksponen: 0,0
o     Bidang
  • AMBIENT public int static final
Bidang ini adalah suatu parameter untuk setMode. Ini menentukan sumber cahaya ambient.
  • directional public int static final
Bidang ini adalah suatu parameter untuk setMode. Ini menentukan sumber cahaya terarah.
  • public static final int OMNI
Bidang ini adalah suatu parameter untuk setMode. Ini menentukan sumber cahaya Omnidirectional.
  • SPOT public int static final
Bidang ini adalah suatu parameter untuk setMode. Ini menentukan sumber cahaya spot.
o     Metode
  • public int getColor ()
Metode ini mengembalikan warna saat ini Cahaya di 0x00RRGGBB format.
  • float publik getConstantAttenuation ()
Metode ini mengembalikan koefisien atenuasi arus konstan.
  • float publik getIntensity ()
Metode ini mengembalikan intensitas arus Cahaya ini.
  • float publik getLinearAttenuation ()
Metode ini mengembalikan koefisien atenuasi linear saat ini.
  • public int getMode ()
Metode ini mengembalikan mode aktif Cahaya ini.
  • float publik getQuadraticAttenuation ()
Metode ini mengembalikan koefisien atenuasi saat kuadrat.
  • float publik getSpotAngle ()
Metode ini mengembalikan sudut spot saat ini objek Light.
  • float publik getSpotExponent ()
Metode ini mengembalikan eksponen spot saat ini objek Light.
  • public void setAttenuation (float konstan, linier mengambang, mengapung kuadrat)
Metode ini menetapkan koefisien atenuasi untuk objek ini Light.
  • public void setColor (int RGB)
Metode ini menyetel warna objek Light.
  • public void setIntensity (intensitas float)
Metode ini menetapkan intensitas objek Light.
  • public void setMode (int mode)
Metode ini menetapkan jenis objek Light.
  • public void setSpotAngle (sudut float)
Metode ini menentukan sudut kerucut tempat untuk objek ini Light.
  • public void setSpotExponent (eksponen float)
Metode ini menetapkan eksponen tempat untuk objek Light.
public class Loader
Apa itu?
Download Loader kelas dan deserializes node grafik adegan, komponen node dan grafik seluruh adegan. Cara yang paling nyaman untuk sebuah aplikasi untuk membuat dan mengisi adegan 3D adalah men-download yang sudah jadi potongan konten 3D dari file M3G. Anda juga bisa mendapatkan objek Image2D dimuat jika Anda memberikan sebuah file gambar PNG dalam parameter metode beban.
Apakah file M3G?

JSR 184 mendefinisikan format file untuk efisien menyimpan data 3D. Data ini dapat dihasilkan dengan bantuan alat pemodelan 3D berbasis PC. Format file ini, yang dikenal sebagai format M3G sepenuhnya kompatibel dengan JSR 184 dan dengan demikian membantu dalam mempercepat laju pengembangan konten 3D untuk aplikasi mobile java.
o     Metode
  • Object3D public static [] beban (byte [] data, int offset)
Metode ini deserializes contoh Object3D dari array byte yang diberikan. Metode ini akan dimulai pada offset tertentu.
  • public static Object3D [] beban (String nama)
Metode ini mengembalikan array contoh Object3D baru dibuat.
masyarakat kelas Bahan
Apa itu?
Bahan kelas mendefinisikan komponen Penampilan yang merangkum materi atribut untuk perhitungan pencahayaan.
o     Konstruktor
  • Bahan publik ()
This constructor creates a Material object with the following default values:
§   vertex color tracking : false (disabled)
§   ambient color : 0x00333333 (0.2, 0.2, 0.2, 0.0)
§   diffuse color : 0xFFCCCCCC (0.8, 0.8, 0.8, 1.0)
§   emissive color : 0x00000000 (0.0, 0.0, 0.0, 0.0)
§   specular color : 0x00000000 (0.0, 0.0, 0.0, 0.0)
§   shininess : 0.0
o     Bidang
  • public static final int AMBIENT
This field is a parameter to the setColor and getColor methods. It specifies that the ambient color component is to be set or retrieved.
  • public static final int DIFFUSE
This field is a parameter to the setColor and getColor methods. It specifies that the diffuse color component is to be set or retrieved.
  • public static final int EMISSIVE
This field is a parameter to the setColor and getColor methods. It specifies that the emissive color component is to be set or retrieved.
  • public static final int SPECULAR
This field is a parameter to the setColor and getColor methods. It specifies that the specular color component is to be set or retrieved.
o     Metode
  • public int getColor (int target)
This method returns the current color of the target property in 0xAARRGGBB format.
  • public float getShininess ()
This method returns the current specular exponent value of this Material.
  • public boolean isVertexColorTrackingEnabled ()
This method returns true if vertex color tracking is enabled. It will return false if it is disabled.
  • public void setColor (int target, int ARGB)
This method sets the given value to the specified color component(s) of this Material.
  • public void setShininess (float shininess)
This method sets the shininess of this Material.
  • public void setVertexColorTrackingEnable (boolean enable)
This method enables or disables vertex color tracking.
public class Mesh
Apa itu?
A Mesh is a scene graph node that represents a 3D object defined as a polygonal surface. Mesh class represents a conventional rigid body mesh. Its derived classes MorphingMesh and SkinnedMesh extend it with capabilities to transform vertices independently of each other.
o     Konstruktor
  • public Mesh (VertexBuffer vertices, IndexBuffer submeshes, Appearance appearances)
This constructor constructs a new Mesh object with the given VertexBuffer and submeshes.
  • public Mesh (VertexBuffer vertices, IndexBuffer submesh, Appearance appearance)
This constructor constructs a new Mesh consisting of only one submesh.
o     Metode
  • publik Appearance getAppearance (int index)
This method returns current Appearance of the submesh at the specified index.
  • public IndexBuffer getIndexBuffer (int index)
This method returns current IndexBuffer at the specified index.
  • public int getSubmeshCount ()
This method returns the number of submeshes in this Mesh.
  • public VertexBuffer getVertexBuffer ()
This method returns the VertexBuffer of this Mesh.
  • public void setAppearance (int index, Appearance appearance)
This methpd sets the Appearance for the specified submesh.
public class MorphingMesh
Apa itu?
MorphingMesh is a scene graph node that represents a vertex morphing polygon mesh. It is equivalent to an ordinary Mesh except that in the case of the MorphingMesh vertices that are rendered are computed as a weighted linear combination of the base VertexBuffer and a number of morph target VertexBuffers.
o     Konstruktor
  • public MorphingMesh (VertexBuffer base, VertexBuffer [] targets, IndexBuffer [] submeshes,Appearance [] appearance)
This constructor contructs a new MorphingMesh with the given base mesh and morph targets.
  • public MorphingMesh (VertexBuffer base, VertexBuffer [] targets, IndexBuffer submesh, Appearance appearance)
This constructor contructs a new MorphingMesh with the given base mesh and morph targets.  
o     Metode
  • public VertexBuffer getMorphTarget (int index)
This method returns the VertexBuffer object at index.
  • public int getMorphTargetCount ()
This method returns the number of morph targets.
  • public void getWeights (float[] weights)
This method gets the current morph target weights for this mesh.
  • public void setWeights (float[] weights)
This method sets the weights for all morph targets in this mesh.
public abstract class Node
Apa itu?
Node is the abstract base class for all scene graph nodes.
Subclasses of class Node
 
The following are the subclasses of class Node:
Camera: This subclass defines the projection from 3D to 2D. It also defines the position of the viewer in the scene.
Mesh     : This subclass defines a 3D object consisting of triangles and also the associated material properties.
Sprite3D: This subclass defines a screen-aligned 2D image with a position in 3D space.
Cahaya     : This subclass defines the position, direction, color and other attributes of a light source.
Kelompok   : This subclass serves as a root for scene graph branches.
o     Bidang
  • public static final int NONE
This field specifies for the setAlignment method that no alignment should be done for the specified axis.
  • public static final int ORIGIN
This field specifies the origin of the reference node as an orientation reference for the setAlignment method.
  • public static final int X_AXIS
This field specifies the X axis of the reference node as an orientation reference for the setAlignment method.
  • public static final int Y_AXIS
This field specifies the Y axis of the reference node as an orientation reference for the setAlignment method.
  • public static final int Z_AXIS
This field specifies the Z axis of the reference node as an orientation reference for the setAlignment method.
o     Metode
  • public final void align (Node reference)
This method applies alignments to this Node and its descendants.
  • public float getAlphaFactor ()
This method retrieves the alpha factor of this Node.
  • public Node getParent ()
This method returns reference to the parent node. It returns null if there is no parent.
  • public int getScope ()
This method returns the current scope of this Node.
  • public boolean getTransformTo (Node target, Transform transform)
This method gets the composite transformation from this node to the given node.
  • public boolean isPickingEnabled ()
This method returns the picking enable flag of this Node.
  • public boolean isRenderingEnabled ()
This method returns the rendering enable flag of this Node.
  • public void setAlignment (Node zRef, int zTarget, Node yRef, int yTarget)
This method sets this node to align with the given other node(s). It may also be used for disabling alignment.
  • public void setAlphaFactor (float alphaFactor)
This method sets the alpha factor for this Node. This method can be used to fade groups of meshes in and out.
  • public void setPickingEnable (boolean enable)
This method sets the picking enable flag of this Node.
  • public void setRenderingEnable (boolean enable)
This method sets the rendering enable flag of this Node.
  • public void setScope (int scope)
This method sets the scope of this node.  
public abstract class Object3D
Apa itu?

Object3D is an abstract base class for all objects that can be part of a 3D world.
o     Metode
  • public void addAnimationTrack (AnimationTrack animationTrack)
This method adds the given AnimationTrack to this Object3D.
  • public int animate (int time)
This method updates all animated properties in this Object3D and all Object3Ds that are reachable from this Object3D.
  • public Object3D duplicate ()
This method creates a duplicate of this Object3D without affecting the existing object.
  • public Object3D find (int userID)
This method returns the first object encountered that has the given user ID. It may return null if no matching objects were found.
  • public AnimationTrack getAnimationTrack (int index)
This method returns the AnimationTrack at the given index.
  • public int getAnimationTrackCount ()
This method returns the number of AnimationTracks bound to this Object3D.
  • public int getReferences (Object3D references)
This method returns the number of direct Object3D references in this object.
  • public int getUserID ()
This method returns the current user ID.
  • public Object getUserObject ()
This method returns the current user object associated with this Object3D.
  • public void removeAnimationTrack (AnimationTrack animationTrack)
This method removes the given AnimationTrack from this Object3D.
  • public void setUserID (int userID)
This method sets the user ID for this object.
  • public void setUserObject (Object userObject)
This method associates an arbitary application specific Object with this Object3D. The given user object replaces any previously set object.
public class PolygonMode
Apa itu?
PolygonMode is an Appearance component encapsulating polygon-level attributes.
o     Konstruktor
  • public PolygonMode ()
This constructor constructs a PolygonMode object with the following default values:
§   culling : CULL_BACK
§   winding : WINDING_CCW
§   shading : SHADE_SMOOTH
§   two-sided lighting: false (disabled)
§   local camera lighting : false (disabled)
§   perspective correction : false (disabled)
o     Bidang
  • public static final int CULL_BACK
This field is a parameter to setCulling. It specifies that the back-facing side of a polygon is not to be drawn.
  • public static final int CULL_FRONT
This field is a parameter to setCulling. It specifies that the front-facing side of a polygon is not to be drawn.
  • public static final int CULL_NONE
This field is a parameter to setCulling. It specifies that both faces of a polygon are to be drawn.
  • public static final int SHADE_FLAT
This field is a parameter to setShading. It specifies that flat shading is to be used.
  • public static final int SHADE_SMOOTH
This field is a parameter to setShading. It specifies that smooth shading is to be used.
  • public static final int WINDING_CCW
This field is a parameter to setWinding. It specifies that a polygon having its vertices in counter-clockwise order in screen space is to be considered front-facing.
  • public static final int WINDING_CW
This field is a parameter to setWinding. It specifies that a polygon having its vertices in clockwise order in screen space is to be considered front-facing.
o     Metode
  • public int getCulling ()
This method returns the current culling mode.
  • public int getShading ()
This method returns the current shading mode which may either be flat or smooth.
  • public int getWinding ()
This method returns the current winding mode.
  • public boolean isTwoSidedLightingEnabled ()
This method returns true if two-sided lighting is enabled. If it is not enabled it returns false.
  • public void setCulling (int mode)
This method sets the polygon culling mode. The culling mode defines which sides of a polygon should not be rendered.
  • public void setLocalCameraLightingEnable (boolean enable)
This method enables or disables local camera lighting.
  • public void setPerspectiveCorrectionEnable (boolean enable)
This method enables or disables perspective correction.
  • public void setShading (int mode)
This method sets the polygon shading mode.
  • public void setTwoSidedLightingEnable (boolean enable)
This method enables or disables two-sided lighting. In case two-sided lighting is enabled the lit colors for the front and back faces of a polygon are computed differently.
  • public void setWinding (int mode)
This method sets the polygon winding mode to clockwise or counter-clockwise. The winding mode decides which side of the polygon is to be considered front.  
public class RayIntersection
Apa itu?
RayIntersection contains a reference to the intersected Mesh or Sprite3D and information about the intersection point. It is filled in by the pick methods in Group. It is strictly a run-time object. RayIntersection cannot be loaded from a file by Loader class.
o     Konstruktor
  • public RayIntersection ()
This constructor constructs a new RayIntersection object with the following default values:
§   ray origin : (0 0 0)
§   ray direction : (0 0 1)
§   intersected node : null
§   intersected submesh index : 0
§   distance to intersection point : 0.0
§   all texture coordinates : 0.0
§   normal vector: (0 0 1)
o     Metode
  • public float getDistance ()
This method returns normalized distance from the pick ray origin to the intersection point.
  • public Node getIntersected ()
This method returns the picked Mesh or Sprite3D object.
  • public float getNormalX ()
This method returns the X component of the surface normal at the intersection point.
  • public float getNormalY ()
This method returns the Y component of the surface normal at the intersection point.
  • public float getNormalZ ()
This method returns the Z component of the surface normal at the intersection point.
  • public void getRay (float[] ray)
This method retrieves the origin (ox oy oz) and direction (dx dy dz) of the pick ray in that order.
  • public int getSubmeshIndex ()
This method returns index of the intersected submesh. This value is always 0 for sprites.
  • public float getTextureS (int index)
This method returns the S texcoord of the specified texturing unit at the intersection point.
  • public float getTextureT (int index)
This method returns the T texcoord of the specified texturing unit at the intersection point.
public class SkinnedMesh
Apa itu?
SkinnedMesh is a scene graph node that represents a skeletally animated polygon mesh.
o     Konstruktor
  • public SkinnedMesh (VertexBuffer vertices, IndexBuffer [] submeshes, Appearance [] appearances, Group skeleton)
This constructor constructs a new SkinnedMesh object with the given vertices, submeshes and skeleton.
  • public SkinnedMesh (VertexBuffer vertices, IndexBuffer submesh, Appearance appearance, Group skeleton)
This constructor constructs a new SkinnedMesh object with the given vertices, submeshes and skeleton.
o     Metode
  • public void addTransform (Node bone, int weight, int firstVertex, int numVertices)
This method associates a weighted transformation (bone) with a range of vertices in this SkinnedMesh.
  • public Group getSkeleton ()
This method returns the skeleton Group of this SkinnedMesh.
public class Sprite3D
Apa itu?

  Sprite3D is a scene graph node that represents a 2-dimensional image with a 3D position.
o     Konstruktor
  • public Sprite3D( boolean scaled, Image2D image, Appearance appearance )
This constructor constructs a new Sprite3D with the scaling mode, image and appearance defined in the parameters.
o     Metode
  • public Appearance getAppearance ()
This method returns the current Appearance of this sprite.
  • public int getCropHeight ()
This method returns the height of the cropping rectangle.
  • public int getCropWidth ()
This method returns the width of the cropping rectangle.
  • public int getCropX ()
This method returns the X offset of the cropping rectangle.
  • public int getCropY ()
This method returns the Y offset of the cropping rectangle.
  • public Image2D getImage ()
This method returns the Image2D object used to draw this sprite.
  • public boolean isScaled ()
This method returns true if this sprite is scaled. If the sprite is unscaled it will return false.
  • public void setAppearance (Appearance appearance)
This method sets the Appearance of this Sprite3D.
  • public void setCrop (int cropX, int cropY, int width, int height)
This method sets a cropping rectangle within the source image.
  • public void setImage (Image2D image)
This method sets the sprite image to display.
public class Texture2D
Apa itu?
Texture2D is an Appearance component whoch encapsulates a two-dimensional texture image and a set of attributes specifying how the image is to be applied on submeshes.
o     Konstruktor
  • public Texture2D (Image2D image)
This constructor constructs a new texture object with the given image and setting the texture attributes to their default values as follows:
§   wrapping S : WRAP_REPEAT
§   wrapping T : WRAP_REPEAT
§   level filter : FILTER_BASE_LEVEL
§   image filter : FILTER_NEAREST
§   blending mode : FUNC_MODULATE
§   blend color : 0x00000000 (transparent black)
o     Bidang
  • public static final int FILTER_BASE_LEVEL
This field refers to a level filtering parameter to setFiltering method that selects the base level image even if mipmap levels exist.
  • public static final int FILTER_LINEAR
This field refers to a parameter to setFiltering method that selects linear filtering.
  • public static final int FILTER_NEAREST
This field refers to a parameter to setFiltering method that selects nearest neighbor filtering.
  • public static final int FUNC_ADD
This field refers to a parameter to setBlending method which specifies that the texel color is to be added to the fragment color.
  • public static final int FUNC_BLEND
This field refers to a parameter to setBlending method which specifies that the texture blend color is to be blended into the fragment color in proportion to the texel RGB values.
  • public static final int FUNC_DECAL
This field refers to a parameter to setBlending method. It specifies that the texel color is to be blended into the fragment color in proportion to the texel alpha.
  • public static final int FUNC_MODULATE
This field refers to a parameter to setBlending method. It specifies that the texel color and/or alpha are to be multiplied with the fragment color and alpha.
  • public static final int FUNC_REPLACE
This field refers to a parameter to setBlending method. It specifies that the texel color and/or alpha are to replace the fragment color and alpha.
  • public static final int WRAP_CLAMP
This field refers to a parameter to setWrapping method. It specifies that the texture image is to be repeated only once.
  • public static final int WRAP_REPEAT
This field refers to a parameter to setWrapping method. It specifies that the texture image is to be repeated indefinitely.
o     Metode
  • public int getBlendColor ()
This method returns the current texture blend color in 0x00RRGGBB format.
  • public int getBlending ()
This method returns the current texture blending function.
  • public Image2D getImage ()
This method returns the current base level texture image.
  • public int getWrappingS ()
This method returns the current S coordinate wrapping mode.
  • public int getWrappingT ()
This method returns the current T coordinate wrapping mode.
  • public void setBlendColor (int RGB)
This method sets the texture blend color for this Texture2D.
  • public void setBlending (int func)
This method chooses the texture blend mode or blend function for this Texture2D.
  • public void setFiltering (int levelFilter, int imageFilter)
This method chooses the filtering mode for this Texture2D.
  • public void setImage (Image2D image)
This method sets the given Image2D as the texture image of this Texture2D.
  • public void setWrapping (int wrapS, int wrapT)
This method sets the wrapping mode for the S and T texture coordinates.
public class Transform
Apa itu?
Transform is a generic 4x4 floating point matrix, representing a transformation.
o     Konstruktor
  • public Transform ()
This constructor constructs a new Transform object and initializes it to the 4x4 identity matrix.
  • public Transform (Transform transform)
This constructor constructs a new Transform object and initializes it by copying the contents of the transform object given as the parameter.
o     Metode
  • public void get (float[] matrix)
This method retrieves the contents of this transformation as a 16-element float array.
  • public void invert ()
This method inverts this matrix incase it is possible. The existing contents are replaced with the result.
  • public void postMultiply (Transform transform)
This method multiplies this transformation from the right by the given transformation.
  • public void postRotate (float angle, float ax, float ay, float az)
This method multiplies this transformation from the right by the given rotation matrix which has been specified in axis-angle form.
  • public void postRotateQuat (float qx, float qy, float qz, float qw)
This method multiplies this transformation from the right by the given rotation matrix which has been specified in quaternion form.
  • public void postScale (float sx, float sy, float sz)
This method multiplies this transformation from the right by the given scale matrix. The existing contents are replaced with the result.
  • public void postTranslate (float tx, float ty, float tz)
This method multiplies this transformation from the right by the given translation matrix. The existing contents are replaced with the result.
  • public void set (float[] matrix)
This method sets this transformation by copying from the given 16-element float array.
  • public void set (Transform transform)
This method sets this transformation by copying the contents of the given Transform.
  • public void setIdentity ()
This method replaces this transformation with the 4x4 identity matrix.
  • public void transform (float[] vectors)
This method multiplies the given array of 4D vectors with this matrix.
  • public void transform (VertexArray in, float[] out, boolean W)
This method multiplies the elements of the given VertexArray with this matrix. It then stores the transformed values in a float array.
  • public void transpose ()
This method transposes this matrix. The existing contents are replaced with the result.
public abstract class Transformable
Apa itu?
Transformable is an abstract base class for Node and Texture2D. It defines common methods for manipulating node and texture transformations.
o     Metode     
  • public void getCompositeTransform (Transform transform)
This method gets the composite transformation matrix of this Transformable.
  • public void getOrientation (float[] angleAxis)
This method gets the orientation component of this Transformable.
  • public void getScale (float[] xyz)
This method gets the scale component of this Transformable.
  • public void getTransform (Transform transform)
This method gets the matrix component of this Transformable.
  • public void getTranslation (float[] xyz)
This method gets the translation component of this Transformable.
  • public void postRotate (float angle, float ax, float ay, float az)
This method multiplies the current orientation component from the right by the given orientation.
  • public void preRotate (float angle, float ax, float ay, float az)
This method multiplies the current orientation component from the left by the given orientation.
  • public void scale (float sx, float sy, float sz)
This method multiplies the current scale component by the given scale factors.
  • public void setOrientation (float angle, float ax, float ay, float az)
This method sets the orientation component of this Transformable.
  • public void setScale (float sx, float sy, float sz)
This method sets the scale component of this Transformable.
  • public void setTransform (Transform transform)
This method sets the matrix component of this Transformable by copying in the given Transform.
  • public void setTranslation (float tx, float ty, float tz)
This method sets the translation component of this Transformable.
  • public void translate (float tx, float ty, float tz)
This method adds the given offset to the current translation component.  
public class TriangleStripArray
Apa itu?
TriangleStripArray class defines an array of triangle strips. The first three vertex indices define the first triangle. Every subsequent index together with the two previous indices defines a new triangle in it.
o     Konstruktor
  • public TriangleStripArray (int[] indices, int[] stripLengths)
This constructor constructs a triangle strip array with explicit indices. The parameters take an array of indices along with the lengths of the individual strips.
  • public TriangleStripArray (int firstIndex, int[] stripLengths)
This constructor constructs a triangle strip array with implicit indices. The parameters define the first index of the first strip along with the lengths of the individual strips.  
public class VertexArray
Apa itu?
VertexArray is an array of integer vectors representing the following:
·    Vertex positions
·    Normals
·    Warna
·    Texture coordinates.
o     Konstruktor
  • public VertexArray (int numVertices, int numComponents, int componentSize)
This constructs constructs a VertexArray based on the value of the parameters.  
o     Metode
  • public void set (int firstVertex, int numVertices, byte[] values)
This method copies an array of 8-bit vertex attributes.
  • public void set (int firstVertex, int numVertices, short[] values)
This method copies an array of 16-bit vertex attributes.
public class VertexBuffer
Apa itu?
This class holds references to VertexArrays that contain the following for a set of vertices:
o     posisi
o     warna
o     normals
o     texture coordinates
o     Pembina
  • public VertexBuffer ()
This constructor constructs an empty VertexBuffer in which all vertex attributes are set to null.
o     Metode
  • public VertexArray getColors ()
This method returns the current VertexArray for vertex colors. It may also return null.
  • public int getDefaultColor ()
This method returns the default vertex color in 0xAARRGGBB format.
  • public VertexArray getNormals ()
This method returns the current VertexArray for vertex normals. It may also return null.
  • public VertexArray getPositions (float[] scaleBias)
This method returns the current VertexArray for vertex positions. It may also return null.
  • public VertexArray getTexCoords (int index, float[] scaleBias)
This method returns VertexArray with the texture coordinates for the given texturing unit. It may also return null.
  • public int getVertexCount ()
This method returns the number of vertices currently in this VertexBuffer. This method may also return zero if no vertex arrays are set.
  • public void setColors (VertexArray colors)
This method sets the per-vertex colors for this VertexBuffer.
  • public void setDefaultColor (int ARGB)
This method sets the color to use in absence of per-vertex colors.
  • public void setNormals (VertexArray normals)
This method sets the normal vectors for this VertexBuffer.
  • public void setPositions (VertexArray positions, float scale, float[] bias)
This method sets the vertex positions for this VertexBuffer.
  • public void setTexCoords (int index, VertexArray texCoords, float scale, float[] bias)
This method sets the texture coordinates for the specified texturing unit. They are specified with a 2- or 3- component VertexArray.
public class World
Apa itu?
Class World extends the class Group. It is a special Group node that is a top-level container for scene graphs.
o     Pembina
  • public World ()
This constructor creates an empty World. The World so constructed has the following default values:
o     Background : null (clear to black)
o     Active camera : null (the world is not renderable)
o     Metode
  • public Camera getActiveCamera ()
This method returns the camera that is currently used to render this World.
  • public Background getBackground ()
This method returns the current attributes for clearing the frame buffer.
  • public void setActiveCamera (Camera camera)
This method sets the Camera to use when rendering this World. The camera must also be a descendant of this World at the time of rendering.
  • public void setBackground (Background background)
This method sets the Background object for this World.

Tidak ada komentar:

Posting Komentar